Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5afce2c817 |
366 changed files with 8263 additions and 7640 deletions
231
.gitignore
vendored
231
.gitignore
vendored
|
|
@ -1,13 +1,220 @@
|
||||||
/common/*
|
#################
|
||||||
|
## Eclipse
|
||||||
|
#################
|
||||||
|
|
||||||
!.gitignore
|
*.pydevproject
|
||||||
!*LICENSE.md
|
.project
|
||||||
!README.md
|
.metadata
|
||||||
!common/assets/
|
common/bin/
|
||||||
!common/mysticores/
|
tmp/
|
||||||
!common/mysticruins/
|
*.tmp
|
||||||
!common/mysticstones/
|
*.bak
|
||||||
!common/mysticworld/
|
*.swp
|
||||||
!common/mcmod.info
|
*~.nib
|
||||||
!common/build.gradle
|
local.properties
|
||||||
!common/gradle*
|
.classpath
|
||||||
|
.settings/
|
||||||
|
.loadpath
|
||||||
|
|
||||||
|
# External tool builders
|
||||||
|
.externalToolBuilders/
|
||||||
|
|
||||||
|
# Locally stored "Eclipse launch configurations"
|
||||||
|
*.launch
|
||||||
|
|
||||||
|
# CDT-specific
|
||||||
|
.cproject
|
||||||
|
|
||||||
|
# PDT-specific
|
||||||
|
.buildpath
|
||||||
|
|
||||||
|
|
||||||
|
#################
|
||||||
|
## Visual Studio
|
||||||
|
#################
|
||||||
|
|
||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
|
||||||
|
[Dd]ebug/
|
||||||
|
[Rr]elease/
|
||||||
|
x64/
|
||||||
|
build/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.log
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
*.ncrunch*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.Publish.xml
|
||||||
|
*.pubxml
|
||||||
|
|
||||||
|
# NuGet Packages Directory
|
||||||
|
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
|
||||||
|
#packages/
|
||||||
|
|
||||||
|
# Windows Azure Build Output
|
||||||
|
csx
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Windows Store app package directory
|
||||||
|
AppPackages/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
sql/
|
||||||
|
*.Cache
|
||||||
|
ClientBin/
|
||||||
|
[Ss]tyle[Cc]op.*
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file to a newer
|
||||||
|
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
App_Data/*.mdf
|
||||||
|
App_Data/*.ldf
|
||||||
|
|
||||||
|
#############
|
||||||
|
## Windows detritus
|
||||||
|
#############
|
||||||
|
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Mac crap
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
|
||||||
|
#############
|
||||||
|
## Python
|
||||||
|
#############
|
||||||
|
|
||||||
|
*.py[co]
|
||||||
|
|
||||||
|
# Packages
|
||||||
|
*.egg
|
||||||
|
*.egg-info
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
eggs/
|
||||||
|
parts/
|
||||||
|
var/
|
||||||
|
sdist/
|
||||||
|
develop-eggs/
|
||||||
|
.installed.cfg
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
.coverage
|
||||||
|
.tox
|
||||||
|
|
||||||
|
#Translations
|
||||||
|
*.mo
|
||||||
|
|
||||||
|
#Mr Developer
|
||||||
|
.mr.developer.cfg
|
||||||
|
|
||||||
|
/mcp/*
|
||||||
|
/eclipse/*
|
||||||
|
/api/*
|
||||||
|
/releases/*
|
||||||
|
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/common" isTestSource="false" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/common/.gradle" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/common/MysticMods" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/common/build" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/common/eclipse" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/common/gradle" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="Gradle: httpclient-4.3.3" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: commons-codec-1.9" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: lwjgl_util-2.9.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: librarylwjglopenal-20100824" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: icu4j-core-mojang-51.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: codecwav-20101023" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: guava-17.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: jopt-simple-4.5" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: log4j-core-2.0-beta9" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: launchwrapper-1.9" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: log4j-api-2.0-beta9" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: httpcore-4.3.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: codecjorbis-20101023" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: config-1.2.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: libraryjavasound-20101123" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: commons-lang3-3.3.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: authlib-1.5.16" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: lwjgl-2.9.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: lwjgl-platform-2.9.1-natives-linux" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: lwjgl-platform-2.9.1-natives-osx" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: commons-compress-1.8.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: asm-debug-all-4.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: jinput-platform-2.0.5-natives-windows" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: soundsystem-20120107" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: commons-io-2.4" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: gson-2.2.4" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: lzma-0.0.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: jinput-platform-2.0.5-natives-osx" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: jutils-1.0.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: netty-all-4.0.10.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: jinput-platform-2.0.5-natives-linux" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: jinput-2.0.5" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: scala-continuations-library_2.11-1.0.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: commons-logging-1.1.3" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: lwjgl-platform-2.9.1-natives-windows" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: realms-1.3.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: akka-actor_2.11-2.3.3" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: twitch-5.16" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: trove4j-3.0.3" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: twitch-external-platform-4.5-natives-windows-32" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: twitch-external-platform-4.5-natives-windows-64" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: twitch-platform-5.16-natives-osx" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: twitch-platform-5.16-natives-windows-32" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: twitch-platform-5.16-natives-windows-64" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: vecmath-1.3.1" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: :forgeSrc:1.7.10-10.13.2.1230" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: D__Modding_Caches__gradle_caches_minecraft_net_minecraftforge_forge_1_7_10_10_13_2_1230_start" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<component inherit-compiler-output="true" inheritJdk="true">
|
|
||||||
<output-test url="file://$MODULE_DIR$/../../MinecraftForge/build/test/MysticMods"/>
|
|
||||||
<exclude-output/>
|
|
||||||
<contentEntry url="file://$MODULE_DIR$">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.gradle"/>
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.settings"/>
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/bin"/>
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build"/>
|
|
||||||
</contentEntry>
|
|
||||||
<levels>
|
|
||||||
<level name="Gradle: forge-1.6.4-9.11.1.964-mcp" value="project"/>
|
|
||||||
</levels>
|
|
||||||
</component>
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/../../MinecraftForge" external.system.id="GRADLE" external.system.module.group="MinecraftForge" external.system.module.version="0.1" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/api/java" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/api/resources" type="java-resource" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/MysticMods" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/eclipse" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: trove4j-3.0.3" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: soundsystem-20120107" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: codecwav-20101023" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: jinput-2.0.5" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: libraryjavasound-20101123" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: jinput-platform-2.0.5-natives-osx" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: jinput-platform-2.0.5-natives-windows" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: asm-debug-all-4.1" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: gson-2.2.4" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: vecmath-1.3.1" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: commons-io-2.4" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: lzma-0.0.1" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: icu4j-core-mojang-51.2" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: launchwrapper-1.9" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: librarylwjglopenal-20100824" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: log4j-api-2.0-beta9" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: jutils-1.0.0" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: codecjorbis-20101023" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: jopt-simple-4.5" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: log4j-core-2.0-beta9" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: netty-all-4.0.10.Final" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: jinput-platform-2.0.5-natives-linux" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="Gradle: forgeSrc-1.7.10-10.13.0.1184" level="project" />
|
|
||||||
<orderEntry type="library" name="Gradle: lwjgl-2.9.1" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
|
|
||||||
|
|
@ -1,37 +1,31 @@
|
||||||
package mysticores.blocks;
|
package mysticores.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticores.MysticOres;
|
|
||||||
import mysticores.items.Items;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.Facing;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class BlockBase extends Block {
|
import mysticores.MysticOres;
|
||||||
IIcon[] textures;
|
import mysticores.items.Items;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Icon;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public BlockBase() {
|
public class BlockBase extends Block {
|
||||||
super(Material.rock);
|
Icon[] textures;
|
||||||
setCreativeTab(MysticOres.MysticOresTab);
|
|
||||||
setHarvestLevel("pickaxe", 2);
|
public BlockBase(int ID) {
|
||||||
setHarvestLevel("pickaxe", 3, 0);
|
super(ID, Material.rock);
|
||||||
setHarvestLevel("pickaxe", 3, 2);
|
setCreativeTab(MysticOres.MysticOresTab);
|
||||||
setHarvestLevel("pickaxe", 1, 6);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -80,7 +74,7 @@ public class BlockBase extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta) {
|
public Icon getIcon(int side, int meta) {
|
||||||
return textures[meta];
|
return textures[meta];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -101,14 +95,14 @@ public class BlockBase extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubBlocks(Item i, CreativeTabs tab, List list) {
|
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||||
for (int meta = 0; meta < BlockHandler.BLOCK_NAMES.size(); meta++) {
|
for (int meta = 0; meta < ItemBase.BLOCK_NAMES.length; meta++) {
|
||||||
list.add(new ItemStack(i, 1, meta));
|
list.add(new ItemStack(i, 1, meta));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int par1, Random random, int par3) {
|
public int idDropped(int par1, Random random, int par3) {
|
||||||
switch (par1) {
|
switch (par1) {
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
|
|
@ -117,20 +111,25 @@ public class BlockBase extends Block {
|
||||||
case 7:
|
case 7:
|
||||||
case 11:
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
return Items.Resource;
|
return Items.Resource.itemID;
|
||||||
case 8:
|
case 8:
|
||||||
return BlackSoulstoneDrops(par1, random, par3);
|
return this.BlackSoulstoneDrops(par1, random, par3);
|
||||||
case 9:
|
case 9:
|
||||||
return BlueSoulstoneDrops(par1, random, par3);
|
return this.BlueSoulstoneDrops(par1, random, par3);
|
||||||
case 10:
|
case 10:
|
||||||
return RedSoulstoneDrops(par1, random, par3);
|
return this.RedSoulstoneDrops(par1, random, par3);
|
||||||
default:
|
default:
|
||||||
return super.getItemDropped(par1, random, par3);
|
return blockID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
public int idPicked(World world, int x, int y, int z) {
|
||||||
|
return this.blockID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) {
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
if (meta == 12)
|
if (meta == 12)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -139,9 +138,9 @@ public class BlockBase extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(){
|
public boolean isOpaqueCube() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int quantityDropped(int meta, int fortune, Random random) {
|
public int quantityDropped(int meta, int fortune, Random random) {
|
||||||
|
|
@ -165,72 +164,79 @@ public class BlockBase extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister register) {
|
public void registerIcons(IconRegister register) {
|
||||||
textures = new IIcon[16];
|
textures = new Icon[16];
|
||||||
for (int i = 0; i < BlockHandler.BLOCK_NAMES.size(); i++) {
|
for (int i = 0; i < ItemBase.BLOCK_NAMES.length; i++) {
|
||||||
textures[i] = register.registerIcon("mysticores:" + BlockHandler.BLOCK_NAMES.get(i));
|
textures[i] = register.registerIcon("MysticMods:" + ItemBase.BLOCK_NAMES[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
public boolean renderAsNormalBlock() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int par) {
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
if (meta == 12 && world.getBlock(x, y, z) == this){
|
int blockID = world.getBlockId(x, y, z);
|
||||||
return !(world.getBlock(x-Facing.offsetsXForSide[side], y-Facing.offsetsYForSide[side], z-Facing.offsetsZForSide[side])==this&&world.getBlockMetadata(x-Facing.offsetsXForSide[side], y-Facing.offsetsYForSide[side], z-Facing.offsetsZForSide[side])==meta);
|
if (meta == 12 && blockID == this.blockID)
|
||||||
}else
|
return false;
|
||||||
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Item BlackSoulstoneDrops(int par1, Random random, int par3) {
|
@Override
|
||||||
|
protected boolean canSilkHarvest() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int BlackSoulstoneDrops(int par1, Random random, int par3) {
|
||||||
int rand = random.nextInt(2);
|
int rand = random.nextInt(2);
|
||||||
switch (rand) {
|
switch (rand) {
|
||||||
case 0:
|
case 0:
|
||||||
return net.minecraft.init.Items.coal;
|
return Item.coal.itemID;
|
||||||
case 1:
|
case 1:
|
||||||
return net.minecraft.init.Items.gunpowder;
|
return Item.gunpowder.itemID;
|
||||||
default:
|
default:
|
||||||
return net.minecraft.init.Items.sugar;
|
return Item.sugar.itemID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Item BlueSoulstoneDrops(int par1, Random random, int par3) {
|
public static int BlueSoulstoneDrops(int par1, Random random, int par3) {
|
||||||
int rand = random.nextInt(5);
|
int rand = random.nextInt(5);
|
||||||
switch (rand) {
|
switch (rand) {
|
||||||
case 0:
|
case 0:
|
||||||
return net.minecraft.init.Items.diamond;
|
return Item.diamond.itemID;
|
||||||
case 1:
|
case 1:
|
||||||
return Item.getItemFromBlock(Blocks.obsidian);
|
return Block.obsidian.blockID;
|
||||||
case 2:
|
case 2:
|
||||||
return net.minecraft.init.Items.gunpowder;
|
return Item.gunpowder.itemID;
|
||||||
case 3:
|
case 3:
|
||||||
return net.minecraft.init.Items.glowstone_dust;
|
return Item.glowstone.itemID;
|
||||||
case 4:
|
case 4:
|
||||||
return net.minecraft.init.Items.blaze_rod;
|
return Item.blazeRod.itemID;
|
||||||
case 5:
|
case 5:
|
||||||
|
return Item.emerald.itemID;
|
||||||
default:
|
default:
|
||||||
return net.minecraft.init.Items.emerald;
|
return Item.emerald.itemID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Item RedSoulstoneDrops(int par1, Random random, int par3) {
|
public static int RedSoulstoneDrops(int par1, Random random, int par3) {
|
||||||
int rand = random.nextInt(4);
|
int rand = random.nextInt(4);
|
||||||
switch (rand) {
|
switch (rand) {
|
||||||
case 0:
|
case 0:
|
||||||
return net.minecraft.init.Items.glowstone_dust;
|
return Item.glowstone.itemID;
|
||||||
case 1:
|
case 1:
|
||||||
return net.minecraft.init.Items.gunpowder;
|
return Item.gunpowder.itemID;
|
||||||
case 2:
|
case 2:
|
||||||
return net.minecraft.init.Items.redstone;
|
return Item.redstone.itemID;
|
||||||
case 3:
|
case 3:
|
||||||
return Item.getItemFromBlock(Blocks.obsidian);
|
return Block.obsidian.blockID;
|
||||||
default:
|
default:
|
||||||
return net.minecraft.init.Items.blaze_powder;
|
return Item.blazePowder.itemID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,17 +1,31 @@
|
||||||
package mysticores.blocks;
|
package mysticores.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import java.util.ArrayList;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
public class BlockHandler {
|
public class BlockHandler {
|
||||||
public static final ArrayList<String> BLOCK_NAMES = new ArrayList<String>(Arrays.asList("Adamantine Ore", "Amethyst Ore", "Iridium Ore", "Mithril Ore", "Tourmaline Ore", "Topaz Ore", "Verdite Ore", "Bloodstone", "Black Soulstone",
|
|
||||||
"Blue Soulstone", "Red Soulstone", "Agate Ore", "Tempered Glass"));
|
|
||||||
public static Block BlockBase;
|
public static Block BlockBase;
|
||||||
|
public static int BASEID = 540;
|
||||||
|
|
||||||
public static void initialize() {
|
public static void initialize() {
|
||||||
BlockBase = GameRegistry.registerBlock(new BlockBase().setStepSound(Block.soundTypeStone), ItemBase.class, "Base Blocks", BLOCK_NAMES);
|
BlockBase = new BlockBase(BASEID).setStepSound(Block.soundStoneFootstep);
|
||||||
|
GameRegistry.registerBlock(BlockBase, ItemBase.class, "Base Blocks");
|
||||||
|
setBlockHarvestLevels();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setBlockHarvestLevels() {
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 0, "pickaxe", 3);
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 1, "pickaxe", 2);
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 2, "pickaxe", 3);
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 3, "pickaxe", 2);
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 4, "pickaxe", 2);
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 5, "pickaxe", 2);
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 6, "pickaxe", 1);
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 7, "pickaxe", 2);
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 8, "pickaxe", 2);
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 9, "pickaxe", 2);
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 10, "pickaxe", 2);
|
||||||
|
MinecraftForge.setBlockHarvestLevel(BlockBase, 11, "pickaxe", 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,36 @@
|
||||||
package mysticores.blocks;
|
package mysticores.blocks;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemBlockWithMetadata;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
public class ItemBase extends ItemBlock {
|
||||||
|
public static String[] BLOCK_NAMES = new String[] { "Adamantine Ore", "Amethyst Ore", "Iridium Ore", "Mithril Ore", "Tourmaline Ore", "Topaz Ore", "Verdite Ore", "Bloodstone", "Black Soulstone",
|
||||||
|
"Blue Soulstone", "Red Soulstone", "Agate Ore", "Tempered Glass" };
|
||||||
|
|
||||||
public class ItemBase extends ItemBlockWithMetadata {
|
public ItemBase(int par1) {
|
||||||
public final ArrayList<String> names;
|
super(par1);
|
||||||
public ItemBase(Block block, ArrayList<String> names) {
|
setMaxDamage(0);
|
||||||
super(block, block);
|
setHasSubtypes(true);
|
||||||
this.names = names;
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Icon getIconFromDamage(int par1) {
|
||||||
|
return BlockHandler.BlockBase.getIcon(2, par1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int par1) {
|
||||||
|
return par1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack itemStack) {
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, names.size());
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BLOCK_NAMES.length);
|
||||||
return names.get(meta);
|
return BLOCK_NAMES[meta];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,24 @@
|
||||||
package mysticores.items;
|
package mysticores.items;
|
||||||
|
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraftforge.common.util.EnumHelper;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.common.EnumHelper;
|
||||||
|
|
||||||
public class EnumTools
|
public class EnumTools
|
||||||
{
|
{
|
||||||
public static final Item.ToolMaterial verditeToolMaterial = EnumHelper.addToolMaterial("Verdite", 1, 262, 5.0F, 1, 5);
|
static EnumToolMaterial verditeToolMaterial = EnumHelper.addToolMaterial("Verdite", 1, 262, 5.0F, 1, 5);
|
||||||
public static final Item.ToolMaterial mithrilToolMaterial = EnumHelper.addToolMaterial("Mithril", 2, 500, 7.0F, 2, 9);
|
static EnumToolMaterial mithrilToolMaterial = EnumHelper.addToolMaterial("Mithril", 2, 500, 7.0F, 2, 9);
|
||||||
public static final Item.ToolMaterial adamantineToolMaterial = EnumHelper.addToolMaterial("Adamantine", 3, 3000, 10.0F, 5, 13);
|
static EnumToolMaterial adamantineToolMaterial = EnumHelper.addToolMaterial("Adamantine", 3, 3000, 10.0F, 5, 13);
|
||||||
public static final Item.ToolMaterial iridiumToolMaterial = EnumHelper.addToolMaterial("Iridium", 3, 4000, 12.0F, 7, 15);
|
static EnumToolMaterial iridiumToolMaterial = EnumHelper.addToolMaterial("Iridium", 3, 4000, 12.0F, 7, 15);
|
||||||
public static final Item.ToolMaterial obsidianToolMaterial = EnumHelper.addToolMaterial("Obsidian", 2, 100, 4.0F, 6, 11);
|
static EnumToolMaterial obsidianToolMaterial = EnumHelper.addToolMaterial("Obsidian", 2, 100, 4.0F, 6, 11);
|
||||||
public static final Item.ToolMaterial bloodstoneToolMaterial = EnumHelper.addToolMaterial("Bloodstone", 3, 200, 16.0F, 8, 12);
|
static EnumToolMaterial bloodstoneToolMaterial = EnumHelper.addToolMaterial("Bloodstone", 3, 200, 16.0F, 8, 12);
|
||||||
|
|
||||||
static {
|
static { verditeToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; }
|
||||||
verditeToolMaterial.customCraftingMaterial = Items.Resource;
|
static { mithrilToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; }
|
||||||
mithrilToolMaterial.customCraftingMaterial = Items.Resource;
|
static { adamantineToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; }
|
||||||
adamantineToolMaterial.customCraftingMaterial = Items.Resource;
|
static { iridiumToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; }
|
||||||
iridiumToolMaterial.customCraftingMaterial = Items.Resource;
|
static { obsidianToolMaterial.customCraftingMaterial = Item.itemsList[Block.obsidian.blockID]; }
|
||||||
obsidianToolMaterial.customCraftingMaterial = Item.getItemFromBlock(Blocks.obsidian);
|
static { bloodstoneToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; }
|
||||||
bloodstoneToolMaterial.customCraftingMaterial = Items.Resource;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
common/MysticOres/Items/ItemAxes.java
Normal file
18
common/MysticOres/Items/ItemAxes.java
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
package mysticores.items;
|
||||||
|
|
||||||
|
import mysticores.MysticOres;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
|
import net.minecraft.item.ItemAxe;
|
||||||
|
|
||||||
|
public class ItemAxes extends ItemAxe {
|
||||||
|
public ItemAxes(int par1, EnumToolMaterial par2EnumToolMaterial) {
|
||||||
|
super(par1, par2EnumToolMaterial);
|
||||||
|
setCreativeTab(MysticOres.MysticOresTab);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
18
common/MysticOres/Items/ItemHoes.java
Normal file
18
common/MysticOres/Items/ItemHoes.java
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
package mysticores.items;
|
||||||
|
|
||||||
|
import mysticores.MysticOres;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
|
import net.minecraft.item.ItemHoe;
|
||||||
|
|
||||||
|
public class ItemHoes extends ItemHoe {
|
||||||
|
public ItemHoes(int par1, EnumToolMaterial par2EnumToolMaterial) {
|
||||||
|
super(par1, par2EnumToolMaterial);
|
||||||
|
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
18
common/MysticOres/Items/ItemPickaxes.java
Normal file
18
common/MysticOres/Items/ItemPickaxes.java
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
package mysticores.items;
|
||||||
|
|
||||||
|
import mysticores.MysticOres;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
|
import net.minecraft.item.ItemPickaxe;
|
||||||
|
|
||||||
|
public class ItemPickaxes extends ItemPickaxe {
|
||||||
|
public ItemPickaxes(int par1, EnumToolMaterial par2EnumToolMaterial) {
|
||||||
|
super(par1, par2EnumToolMaterial);
|
||||||
|
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,36 +1,38 @@
|
||||||
package mysticores.items;
|
package mysticores.items;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import mysticores.MysticOres;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Icon;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemResource extends Item {
|
public class ItemResource extends Item {
|
||||||
private IIcon[] icons;
|
private Icon[] icons;
|
||||||
private static final String[] RESOURCE_TYPES = new String[] { "Verdite Ingot", "Mithril Ingot", "Adamantine Ingot", "Iridium Ingot", "Iridium Nugget", "Tourmaline Gem", "Agate Gem", "Topaz Gem",
|
private static final String[] RESOURCE_TYPES = new String[] { "Verdite Ingot", "Mithril Ingot", "Adamantine Ingot", "Iridium Ingot", "Iridium Nugget", "Tourmaline Gem", "Agate Gem", "Topaz Gem",
|
||||||
"Amethyst Gem", "Mystic Powder", "Bloodstone Shard", "Glass Shard", "Obsidian Shard", "Obsidian Rod" };
|
"Amethyst Gem", "Mystic Powder", "Bloodstone Shard", "Glass Shard", "Obsidian Shard", "Obsidian Rod" };
|
||||||
|
|
||||||
public ItemResource() {
|
public ItemResource(int id) {
|
||||||
super();
|
super(id);
|
||||||
this.setHasSubtypes(true);
|
this.setHasSubtypes(true);
|
||||||
|
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIconFromDamage(int meta) {
|
public Icon getIconFromDamage(int meta) {
|
||||||
int j = MathHelper.clamp_int(meta, 0, RESOURCE_TYPES.length);
|
int j = MathHelper.clamp_int(meta, 0, RESOURCE_TYPES.length);
|
||||||
return icons[j];
|
return icons[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||||
for (int var4 = 0; var4 < RESOURCE_TYPES.length; var4++)
|
for (int var4 = 0; var4 < RESOURCE_TYPES.length; var4++)
|
||||||
par3List.add(new ItemStack(par1, 1, var4));
|
par3List.add(new ItemStack(par1, 1, var4));
|
||||||
}
|
}
|
||||||
|
|
@ -43,9 +45,9 @@ public class ItemResource extends Item {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
icons = new IIcon[RESOURCE_TYPES.length];
|
icons = new Icon[RESOURCE_TYPES.length];
|
||||||
for (int i = 0; i < RESOURCE_TYPES.length; ++i)
|
for (int i = 0; i < RESOURCE_TYPES.length; ++i)
|
||||||
icons[i] = iconRegister.registerIcon("mysticores:" + RESOURCE_TYPES[i]);
|
icons[i] = iconRegister.registerIcon("MysticMods:" + RESOURCE_TYPES[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,40 @@
|
||||||
package mysticores.items;
|
package mysticores.items;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import mysticores.MysticOres;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemSatchel extends Item {
|
public class ItemSatchel extends Item {
|
||||||
public ItemSatchel() {
|
public ItemSatchel(int par1) {
|
||||||
super();
|
super(par1);
|
||||||
|
setCreativeTab(MysticOres.MysticOresTab);
|
||||||
|
maxStackSize = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean hasEffect(ItemStack par1ItemStack, int i) {
|
public boolean hasEffect(ItemStack par1ItemStack) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player) {
|
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player) {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
player.displayGUIChest(player.getInventoryEnderChest());
|
IInventory inv;
|
||||||
|
inv = player.getInventoryEnderChest();
|
||||||
|
player.displayGUIChest(inv);
|
||||||
}
|
}
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
common/MysticOres/Items/ItemShovels.java
Normal file
18
common/MysticOres/Items/ItemShovels.java
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
package mysticores.items;
|
||||||
|
|
||||||
|
import mysticores.MysticOres;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
|
import net.minecraft.item.ItemSpade;
|
||||||
|
|
||||||
|
public class ItemShovels extends ItemSpade {
|
||||||
|
public ItemShovels(int par1, EnumToolMaterial par2EnumToolMaterial) {
|
||||||
|
super(par1, par2EnumToolMaterial);
|
||||||
|
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
18
common/MysticOres/Items/ItemSwords.java
Normal file
18
common/MysticOres/Items/ItemSwords.java
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
package mysticores.items;
|
||||||
|
|
||||||
|
import mysticores.MysticOres;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
|
import net.minecraft.item.ItemSword;
|
||||||
|
|
||||||
|
public class ItemSwords extends ItemSword {
|
||||||
|
public ItemSwords(int par1, EnumToolMaterial par2EnumToolMaterial) {
|
||||||
|
super(par1, par2EnumToolMaterial);
|
||||||
|
setCreativeTab(MysticOres.MysticOresTab);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,66 +1,74 @@
|
||||||
package mysticores.items;
|
package mysticores.items;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import mysticores.lib.ItemID;
|
||||||
import mysticores.MysticOres;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemHoe;
|
|
||||||
import net.minecraft.item.ItemSpade;
|
|
||||||
import net.minecraft.item.ItemSword;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
public class Items {
|
public class Items {
|
||||||
public static Item VerditeSword, VerditePickaxe, VerditeShovel, VerditeAxe, VerditeHoe;
|
public static Item VerditeSword;
|
||||||
public static Item MithrilSword, MithrilPickaxe, MithrilShovel, MithrilAxe, MithrilHoe;
|
public static Item VerditePickaxe;
|
||||||
public static Item AdamantineSword, AdamantinePickaxe, AdamantineShovel, AdamantineAxe, AdamantineHoe;
|
public static Item VerditeShovel;
|
||||||
public static Item IridiumSword, IridiumPickaxe, IridiumShovel, IridiumAxe, IridiumHoe;
|
public static Item VerditeAxe;
|
||||||
public static Item BloodstoneSword, BloodstonePickaxe, BloodstoneShovel, BloodstoneAxe, BloodstoneHoe;
|
public static Item VerditeHoe;
|
||||||
public static Item ObsidianSword, ObsidianPickaxe, ObsidianShovel, ObsidianAxe, ObsidianHoe;
|
public static Item MithrilSword;
|
||||||
|
public static Item MithrilPickaxe;
|
||||||
|
public static Item MithrilShovel;
|
||||||
|
public static Item MithrilAxe;
|
||||||
|
public static Item MithrilHoe;
|
||||||
|
public static Item AdamantineSword;
|
||||||
|
public static Item AdamantinePickaxe;
|
||||||
|
public static Item AdamantineShovel;
|
||||||
|
public static Item AdamantineAxe;
|
||||||
|
public static Item AdamantineHoe;
|
||||||
|
public static Item IridiumSword;
|
||||||
|
public static Item IridiumPickaxe;
|
||||||
|
public static Item IridiumShovel;
|
||||||
|
public static Item IridiumAxe;
|
||||||
|
public static Item IridiumHoe;
|
||||||
|
public static Item BloodstoneSword;
|
||||||
|
public static Item BloodstonePickaxe;
|
||||||
|
public static Item BloodstoneShovel;
|
||||||
|
public static Item BloodstoneAxe;
|
||||||
|
public static Item BloodstoneHoe;
|
||||||
|
public static Item ObsidianSword;
|
||||||
|
public static Item ObsidianPickaxe;
|
||||||
|
public static Item ObsidianShovel;
|
||||||
|
public static Item ObsidianAxe;
|
||||||
|
public static Item ObsidianHoe;
|
||||||
public static Item Resource;
|
public static Item Resource;
|
||||||
public static Item Satchel;
|
public static Item Satchel;
|
||||||
|
|
||||||
public static void initialize() {
|
public static void initialize() {
|
||||||
Resource = new ItemResource().setUnlocalizedName("Resources");
|
Resource = new ItemResource(ItemID.RESOURCES);
|
||||||
VerditeSword = new ItemSword(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeSword");
|
VerditeSword = new ItemSwords(ItemID.VERDITESWORD, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeSword");
|
||||||
VerditePickaxe = new ItemPick(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditePickaxe");
|
VerditePickaxe = new ItemPickaxes(ItemID.VERDITEPICKAXE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditePickaxe");
|
||||||
VerditeShovel = new ItemSpade(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeShovel");
|
VerditeShovel = new ItemShovels(ItemID.VERDITESHOVEL, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeShovel");
|
||||||
VerditeAxe = new ItemHatchet(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeAxe");
|
VerditeAxe = new ItemAxes(ItemID.VERDITEAXE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeAxe");
|
||||||
VerditeHoe = new ItemHoe(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeHoe");
|
VerditeHoe = new ItemHoes(ItemID.VERDITEHOE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeHoe");
|
||||||
MithrilSword = new ItemSword(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilSword");
|
MithrilSword = new ItemSwords(ItemID.MITHRILSWORD, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilSword");
|
||||||
MithrilPickaxe = new ItemPick(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilPickaxe");
|
MithrilPickaxe = new ItemPickaxes(ItemID.MITHRILPICKAXE, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilPickaxe");
|
||||||
MithrilShovel = new ItemSpade(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilShovel");
|
MithrilShovel = new ItemShovels(ItemID.MITHRILSHOVEL, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilShovel");
|
||||||
MithrilAxe = new ItemHatchet(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilAxe");
|
MithrilAxe = new ItemAxes(ItemID.MITHRILAXE, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilAxe");
|
||||||
MithrilHoe = new ItemHoe(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilHoe");
|
MithrilHoe = new ItemHoes(ItemID.MITHRILHOE, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilHoe");
|
||||||
AdamantineSword = new ItemSword(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineSword");
|
AdamantineSword = new ItemSwords(ItemID.ADAMANTINESWORD, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineSword");
|
||||||
AdamantinePickaxe = new ItemPick(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantinePickaxe");
|
AdamantinePickaxe = new ItemPickaxes(ItemID.ADAMANTINEPICKAXE, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantinePickaxe");
|
||||||
AdamantineShovel = new ItemSpade(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineShovel");
|
AdamantineShovel = new ItemShovels(ItemID.ADAMANTINESHOVEL, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineShovel");
|
||||||
AdamantineAxe = new ItemHatchet(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineAxe");
|
AdamantineAxe = new ItemAxes(ItemID.ADAMANTINEAXE, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineAxe");
|
||||||
AdamantineHoe = new ItemHoe(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineHoe");
|
AdamantineHoe = new ItemHoes(ItemID.ADAMANTINEHOE, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineHoe");
|
||||||
IridiumSword = new ItemSword(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumSword");
|
IridiumSword = new ItemSwords(ItemID.IRIDIUMSWORD, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumSword");
|
||||||
IridiumPickaxe = new ItemPick(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumPickaxe");
|
IridiumPickaxe = new ItemPickaxes(ItemID.IRIDIUMPICKAXE, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumPickaxe");
|
||||||
IridiumShovel = new ItemSpade(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumShovel");
|
IridiumShovel = new ItemShovels(ItemID.IRIDIUMSHOVEL, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumShovel");
|
||||||
IridiumAxe = new ItemHatchet(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumAxe");
|
IridiumAxe = new ItemAxes(ItemID.IRIDIUMAXE, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumAxe");
|
||||||
IridiumHoe = new ItemHoe(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumHoe");
|
IridiumHoe = new ItemHoes(ItemID.IRIDIUMHOE, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumHoe");
|
||||||
BloodstoneSword = new ItemSword(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneSword");
|
BloodstoneSword = new ItemSwords(ItemID.BLOODSTONESWORD, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneSword");
|
||||||
BloodstonePickaxe = new ItemPick(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstonePickaxe");
|
BloodstonePickaxe = new ItemPickaxes(ItemID.BLOODSTONEPICKAXE, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstonePickaxe");
|
||||||
BloodstoneShovel = new ItemSpade(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneShovel");
|
BloodstoneShovel = new ItemShovels(ItemID.BLOODSTONESHOVEL, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneShovel");
|
||||||
BloodstoneAxe = new ItemHatchet(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneAxe");
|
BloodstoneAxe = new ItemAxes(ItemID.BLOODSTONEAXE, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneAxe");
|
||||||
BloodstoneHoe = new ItemHoe(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneHoe");
|
BloodstoneHoe = new ItemHoes(ItemID.BLOODSTONEHOE, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneHoe");
|
||||||
ObsidianSword = new ItemSword(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianSword");
|
ObsidianSword = new ItemSwords(ItemID.OBSIDIANSWORD, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianSword");
|
||||||
ObsidianPickaxe = new ItemPick(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianPickaxe");
|
ObsidianPickaxe = new ItemPickaxes(ItemID.OBSIDIANPICKAXE, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianPickaxe");
|
||||||
ObsidianShovel = new ItemSpade(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianShovel");
|
ObsidianShovel = new ItemShovels(ItemID.OBSIDIANSHOVEL, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianShovel");
|
||||||
ObsidianAxe = new ItemHatchet(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianAxe");
|
ObsidianAxe = new ItemAxes(ItemID.OBSIDIANAXE, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianAxe");
|
||||||
ObsidianHoe = new ItemHoe(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianHoe");
|
ObsidianHoe = new ItemHoes(ItemID.OBSIDIANHOE, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianHoe");
|
||||||
Satchel = new ItemSatchel().setMaxStackSize(1).setUnlocalizedName("Satchel");
|
Satchel = new ItemSatchel(ItemID.SATCHEL).setUnlocalizedName("Satchel");
|
||||||
try {
|
|
||||||
for(Field f:Items.class.getFields()){
|
|
||||||
Item it = (Item) f.get(null);
|
|
||||||
it.setCreativeTab(MysticOres.MysticOresTab);
|
|
||||||
String reg = it.getUnlocalizedName().substring(5);
|
|
||||||
it.setTextureName("mysticores:"+reg);
|
|
||||||
GameRegistry.registerItem(it,reg);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
36
common/MysticOres/Lib/ItemID.java
Normal file
36
common/MysticOres/Lib/ItemID.java
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
package mysticores.lib;
|
||||||
|
|
||||||
|
public class ItemID {
|
||||||
|
public static int VERDITESWORD = 7050;
|
||||||
|
public static int VERDITEPICKAXE = 7051;
|
||||||
|
public static int VERDITESHOVEL = 7052;
|
||||||
|
public static int VERDITEAXE = 7053;
|
||||||
|
public static int VERDITEHOE = 7054;
|
||||||
|
public static int MITHRILSWORD = 7055;
|
||||||
|
public static int MITHRILPICKAXE = 7056;
|
||||||
|
public static int MITHRILSHOVEL = 7057;
|
||||||
|
public static int MITHRILAXE = 7058;
|
||||||
|
public static int MITHRILHOE = 7059;
|
||||||
|
public static int ADAMANTINESWORD = 7060;
|
||||||
|
public static int ADAMANTINEPICKAXE = 7061;
|
||||||
|
public static int ADAMANTINESHOVEL = 7062;
|
||||||
|
public static int ADAMANTINEAXE = 7063;
|
||||||
|
public static int ADAMANTINEHOE = 7064;
|
||||||
|
public static int IRIDIUMSWORD = 7065;
|
||||||
|
public static int IRIDIUMPICKAXE = 7066;
|
||||||
|
public static int IRIDIUMSHOVEL = 7067;
|
||||||
|
public static int IRIDIUMAXE = 7068;
|
||||||
|
public static int IRIDIUMHOE = 7069;
|
||||||
|
public static int OBSIDIANSWORD = 7070;
|
||||||
|
public static int OBSIDIANPICKAXE = 7071;
|
||||||
|
public static int OBSIDIANSHOVEL = 7072;
|
||||||
|
public static int OBSIDIANAXE = 7073;
|
||||||
|
public static int OBSIDIANHOE = 7074;
|
||||||
|
public static int BLOODSTONESWORD = 7075;
|
||||||
|
public static int BLOODSTONEPICKAXE = 7076;
|
||||||
|
public static int BLOODSTONESHOVEL = 7077;
|
||||||
|
public static int BLOODSTONEAXE = 7078;
|
||||||
|
public static int BLOODSTONEHOE = 7079;
|
||||||
|
public static int SATCHEL = 7080;
|
||||||
|
public static int RESOURCES = 7081;
|
||||||
|
}
|
||||||
|
|
@ -1,39 +1,33 @@
|
||||||
package mysticores;
|
package mysticores;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.items.Items;
|
||||||
|
import mysticores.util.ConfigurationManager;
|
||||||
|
import mysticores.util.Localizations;
|
||||||
|
import mysticores.util.OreDictManager;
|
||||||
|
import mysticores.util.RecipeManager;
|
||||||
|
import mysticores.util.TabMysticOres;
|
||||||
|
import mysticores.worldgen.GeneratorManager;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
import cpw.mods.fml.common.IFuelHandler;
|
import cpw.mods.fml.common.IFuelHandler;
|
||||||
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.event.FMLMissingMappingsEvent;
|
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
import cpw.mods.fml.common.registry.GameData;
|
import cpw.mods.fml.common.network.NetworkMod;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticores.blocks.BlockHandler;
|
|
||||||
import mysticores.items.Items;
|
|
||||||
import mysticores.util.ConfigurationManager;
|
|
||||||
import mysticores.util.RecipeManager;
|
|
||||||
import mysticores.worldgen.WorldGenOres;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
|
||||||
|
|
||||||
@Mod(modid = "mysticores", name = "Mystic Ores", version = "0.1")
|
@Mod(modid = "MysticOres", name = "Mystic Ores", version = "0.1")
|
||||||
public final class MysticOres implements IFuelHandler {
|
@NetworkMod(clientSideRequired = true)
|
||||||
@Instance("mysticores")
|
public class MysticOres implements IFuelHandler {
|
||||||
|
@Instance("MysticOres")
|
||||||
public static MysticOres instance;
|
public static MysticOres instance;
|
||||||
public boolean ENABLE = true;
|
public static final CreativeTabs MysticOresTab = new TabMysticOres("MysticOresTab");
|
||||||
public static CreativeTabs MysticOresTab;
|
|
||||||
public static final String[] INGOTS = { "ingotVerdite", "ingotMithril", "ingotAdamantine", "ingotIridium", "fuelIridium", "gemTourmaline", "gemAgate", "gemTopaz", "gemAmethyst", "dustMystic",
|
|
||||||
" shardBloodstone", "shardGlass", "shardObsidian", "rodObsidian" };
|
|
||||||
public static final String[] ORES = { "oreAdamantine", "oreAmethyst", "oreIridium", "oreMithril", "oreSapphire", "oreTopaz", "oreVerdite", "oreBloodstone", "oreBlackSoulstone",
|
|
||||||
"oreBlueSoulstone", "oreRedSoulstone", "oreAgate" };
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBurnTime(ItemStack fuel) {
|
public int getBurnTime(ItemStack fuel) {
|
||||||
if (fuel.getItem() == Items.Resource && fuel.getItemDamage() == 4)
|
if (fuel.getItem().itemID == Items.Resource.itemID && fuel.getItemDamage() == 4)
|
||||||
return 12800;
|
return 12800;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -42,41 +36,12 @@ public final class MysticOres implements IFuelHandler {
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent event) {
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
ConfigurationManager.initialize(event.getSuggestedConfigurationFile());
|
ConfigurationManager.initialize(event.getSuggestedConfigurationFile());
|
||||||
if(ENABLE){
|
BlockHandler.initialize();
|
||||||
MysticOresTab = new CreativeTabs("MysticOresTab") {
|
Items.initialize();
|
||||||
|
OreDictManager.initialize();
|
||||||
@Override
|
RecipeManager.initialize();
|
||||||
public Item getTabIconItem() {
|
GeneratorManager.initialize();
|
||||||
return Item.getItemFromBlock(BlockHandler.BlockBase);
|
Localizations.initialize();
|
||||||
}
|
GameRegistry.registerFuelHandler(this);
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public int func_151243_f()
|
|
||||||
{
|
|
||||||
return 7;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
BlockHandler.initialize();
|
|
||||||
Items.initialize();
|
|
||||||
for (int i = 0; i < INGOTS.length; i++) {
|
|
||||||
OreDictionary.registerOre(INGOTS[i], new ItemStack(Items.Resource, 1, i));
|
|
||||||
}
|
|
||||||
for (int i = 0; i < ORES.length; i++) {
|
|
||||||
OreDictionary.registerOre(ORES[i], new ItemStack(BlockHandler.BlockBase, 1, i));
|
|
||||||
}
|
|
||||||
RecipeManager.initialize();
|
|
||||||
GameRegistry.registerWorldGenerator(new WorldGenOres(), 100);
|
|
||||||
GameRegistry.registerFuelHandler(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onRemap(FMLMissingMappingsEvent event){
|
|
||||||
for(FMLMissingMappingsEvent.MissingMapping missingMapping : event.get()){
|
|
||||||
if(missingMapping.type.name().equals("ITEM") && missingMapping.name.contains("item.")){
|
|
||||||
missingMapping.remap(GameData.getItemRegistry().getObject(missingMapping.name.replace("item.mysticores:r", "R").replace("item.", "")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,15 +1,48 @@
|
||||||
package mysticores.util;
|
package mysticores.util;
|
||||||
|
|
||||||
import mysticores.MysticOres;
|
|
||||||
import mysticores.lib.Rarity;
|
|
||||||
import net.minecraftforge.common.config.Configuration;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.lib.ItemID;
|
||||||
|
import mysticores.lib.Rarity;
|
||||||
|
import net.minecraftforge.common.Configuration;
|
||||||
|
|
||||||
public class ConfigurationManager {
|
public class ConfigurationManager {
|
||||||
public static void initialize(File file) {
|
public static void initialize(File file) {
|
||||||
Configuration config = new Configuration(file);
|
Configuration config = new Configuration(file);
|
||||||
MysticOres.instance.ENABLE = config.get("General", "Enable", true).getBoolean();
|
ItemID.RESOURCES = config.getItem("Resource Items", ItemID.RESOURCES).getInt();
|
||||||
|
ItemID.VERDITESWORD = config.getItem("Tools", "Verdite Sword", ItemID.VERDITESWORD).getInt();
|
||||||
|
ItemID.VERDITEPICKAXE = config.getItem("Tools", "Verdite Pickaxe", ItemID.VERDITEPICKAXE).getInt();
|
||||||
|
ItemID.VERDITESHOVEL = config.getItem("Tools", "Verdite Shovel", ItemID.VERDITESHOVEL).getInt();
|
||||||
|
ItemID.VERDITEAXE = config.getItem("Tools", "Verdite Axe", ItemID.VERDITEAXE).getInt();
|
||||||
|
ItemID.VERDITEHOE = config.getItem("Tools", "Verdite Hoe", ItemID.VERDITEHOE).getInt();
|
||||||
|
ItemID.MITHRILSWORD = config.getItem("Tools", "Mithril Sword", ItemID.MITHRILSWORD).getInt();
|
||||||
|
ItemID.MITHRILPICKAXE = config.getItem("Tools", "Mithril Pickaxe", ItemID.MITHRILPICKAXE).getInt();
|
||||||
|
ItemID.MITHRILSHOVEL = config.getItem("Tools", "Mithril Shovel", ItemID.MITHRILSHOVEL).getInt();
|
||||||
|
ItemID.MITHRILAXE = config.getItem("Tools", "Mithril Axe", ItemID.MITHRILAXE).getInt();
|
||||||
|
ItemID.MITHRILHOE = config.getItem("Tools", "Mithril Hoe", ItemID.MITHRILHOE).getInt();
|
||||||
|
ItemID.ADAMANTINESWORD = config.getItem("Tools", "Adamantine Sword", ItemID.ADAMANTINESWORD).getInt();
|
||||||
|
ItemID.ADAMANTINEPICKAXE = config.getItem("Tools", "Adamantine Pickaxe", ItemID.ADAMANTINEPICKAXE).getInt();
|
||||||
|
ItemID.ADAMANTINESHOVEL = config.getItem("Tools", "Adamantine Shovel", ItemID.ADAMANTINESHOVEL).getInt();
|
||||||
|
ItemID.ADAMANTINEAXE = config.getItem("Tools", "Adamantine Axe", ItemID.ADAMANTINEAXE).getInt();
|
||||||
|
ItemID.ADAMANTINEHOE = config.getItem("Tools", "Adamantine Hoe", ItemID.ADAMANTINEHOE).getInt();
|
||||||
|
ItemID.IRIDIUMSWORD = config.getItem("Tools", "Iridium Sword", ItemID.IRIDIUMSWORD).getInt();
|
||||||
|
ItemID.IRIDIUMPICKAXE = config.getItem("Tools", "Iridium Pickaxe", ItemID.IRIDIUMPICKAXE).getInt();
|
||||||
|
ItemID.IRIDIUMSHOVEL = config.getItem("Tools", "Iridium Shovel", ItemID.IRIDIUMSHOVEL).getInt();
|
||||||
|
ItemID.IRIDIUMAXE = config.getItem("Tools", "Iridium Axe", ItemID.IRIDIUMAXE).getInt();
|
||||||
|
ItemID.IRIDIUMHOE = config.getItem("Tools", "Iridium Hoe", ItemID.IRIDIUMHOE).getInt();
|
||||||
|
ItemID.BLOODSTONESWORD = config.getItem("Tools", "Bloodstone Sword", ItemID.BLOODSTONESWORD).getInt();
|
||||||
|
ItemID.BLOODSTONEPICKAXE = config.getItem("Tools", "Bloodstone Pickaxe", ItemID.BLOODSTONEPICKAXE).getInt();
|
||||||
|
ItemID.BLOODSTONESHOVEL = config.getItem("Tools", "Bloodstone Shovel", ItemID.BLOODSTONESHOVEL).getInt();
|
||||||
|
ItemID.BLOODSTONEAXE = config.getItem("Tools", "Bloodstone Axe", ItemID.BLOODSTONEAXE).getInt();
|
||||||
|
ItemID.BLOODSTONEHOE = config.getItem("Tools", "Bloodstone Hoe", ItemID.BLOODSTONEHOE).getInt();
|
||||||
|
ItemID.OBSIDIANSWORD = config.getItem("Tools", "Obsidian Sword", ItemID.OBSIDIANSWORD).getInt();
|
||||||
|
ItemID.OBSIDIANPICKAXE = config.getItem("Tools", "Obsidian Pickaxe", ItemID.OBSIDIANPICKAXE).getInt();
|
||||||
|
ItemID.OBSIDIANSHOVEL = config.getItem("Tools", "Obsidian Shovel", ItemID.OBSIDIANSHOVEL).getInt();
|
||||||
|
ItemID.OBSIDIANAXE = config.getItem("Tools", "Obsidian Axe", ItemID.OBSIDIANAXE).getInt();
|
||||||
|
ItemID.OBSIDIANHOE = config.getItem("Tools", "Obsidian Hoe", ItemID.OBSIDIANHOE).getInt();
|
||||||
|
ItemID.SATCHEL = config.getItem("Satchel ID", ItemID.SATCHEL).getInt();
|
||||||
|
BlockHandler.BASEID = config.getBlock("Base Block ID", BlockHandler.BASEID).getInt();
|
||||||
Rarity.VERDITE = config.get("Ore Rarity", "Verdite Ore", Rarity.VERDITE).getInt();
|
Rarity.VERDITE = config.get("Ore Rarity", "Verdite Ore", Rarity.VERDITE).getInt();
|
||||||
Rarity.MITHRIL = config.get("Ore Rarity", "Mithril Ore", Rarity.MITHRIL).getInt();
|
Rarity.MITHRIL = config.get("Ore Rarity", "Mithril Ore", Rarity.MITHRIL).getInt();
|
||||||
Rarity.ADAMANTINE = config.get("Ore Rarity", "Adamantine Ore", Rarity.ADAMANTINE).getInt();
|
Rarity.ADAMANTINE = config.get("Ore Rarity", "Adamantine Ore", Rarity.ADAMANTINE).getInt();
|
||||||
|
|
|
||||||
95
common/MysticOres/Util/Localizations.java
Normal file
95
common/MysticOres/Util/Localizations.java
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
package mysticores.util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipException;
|
||||||
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
|
import mysticores.MysticOres;
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* All credits go to copygirl (or copy....boy) for this one
|
||||||
|
* Couldn't have done any of this without your
|
||||||
|
* repository, many thanks friend c:
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class Localizations {
|
||||||
|
private Localizations() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initialize() {
|
||||||
|
File source = Loader.instance().getReversedModObjectList().get(MysticOres.instance).getSource();
|
||||||
|
Pattern pattern = Pattern.compile(".*(assets/" + "mysticmods/lang/(.+)\\.(.+))");
|
||||||
|
for (String file : getResources(source, pattern)) {
|
||||||
|
Matcher matcher = pattern.matcher(file);
|
||||||
|
matcher.find();
|
||||||
|
String resource = "/" + matcher.group(1);
|
||||||
|
String lang = matcher.group(2);
|
||||||
|
boolean isXML = matcher.group(3).equalsIgnoreCase("XML");
|
||||||
|
LanguageRegistry.instance().loadLocalization(resource, lang, isXML);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Collection<String> getResources(File file, Pattern pattern) {
|
||||||
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
|
if (file.isDirectory())
|
||||||
|
retval.addAll(getResourcesFromDirectory(file, pattern));
|
||||||
|
else
|
||||||
|
retval.addAll(getResourcesFromJarFile(file, pattern));
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Collection<String> getResourcesFromDirectory(File directory, Pattern pattern) {
|
||||||
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
|
File[] FileList = directory.listFiles();
|
||||||
|
for (File file : FileList) {
|
||||||
|
if (file.isDirectory()) {
|
||||||
|
retval.addAll(getResourcesFromDirectory(file, pattern));
|
||||||
|
} else
|
||||||
|
try {
|
||||||
|
String fileName = file.getCanonicalPath().replace('\\', '/');
|
||||||
|
boolean accept = pattern.matcher(fileName).matches();
|
||||||
|
if (accept)
|
||||||
|
retval.add(fileName);
|
||||||
|
} catch (final IOException e) {
|
||||||
|
throw new Error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Collection<String> getResourcesFromJarFile(File file, Pattern pattern) {
|
||||||
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
|
ZipFile Zip;
|
||||||
|
try {
|
||||||
|
Zip = new ZipFile(file);
|
||||||
|
} catch (ZipException Ex) {
|
||||||
|
throw new Error(Ex);
|
||||||
|
} catch (IOException Ex) {
|
||||||
|
throw new Error(Ex);
|
||||||
|
}
|
||||||
|
Enumeration<? extends ZipEntry> entries = Zip.entries();
|
||||||
|
while (entries.hasMoreElements()) {
|
||||||
|
ZipEntry ZipE = entries.nextElement();
|
||||||
|
String FileName = ZipE.getName();
|
||||||
|
boolean accept = pattern.matcher(FileName).matches();
|
||||||
|
if (accept)
|
||||||
|
retval.add(FileName);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Zip.close();
|
||||||
|
} catch (IOException Ex) {
|
||||||
|
throw new Error(Ex);
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
common/MysticOres/Util/OreDictManager.java
Normal file
22
common/MysticOres/Util/OreDictManager.java
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
package mysticores.util;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.items.Items;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
|
public class OreDictManager {
|
||||||
|
public static final String[] INGOTS = { "ingotVerdite", "ingotMithril", "ingotAdamantine", "ingotIridium", "fuelIridium", "gemTourmaline", "gemAgate", "gemTopaz", "gemAmethyst", "dustMystic",
|
||||||
|
" shardBloodstone", "shardGlass", "shardObsidian", "rodObsidian" };
|
||||||
|
public static final String[] ORES = { "oreAdamantine", "oreAmethyst", "oreIridium", "oreMithril", "oreSapphire", "oreTopaz", "oreVerdite", "oreBloodstone", "oreBlackSoulstone",
|
||||||
|
"oreBlueSoulstone", "oreRedSoulstone", "oreAgate" };
|
||||||
|
|
||||||
|
public static void initialize() {
|
||||||
|
for (int i = 0; i < INGOTS.length; i++) {
|
||||||
|
OreDictionary.registerOre(INGOTS[i], new ItemStack(Items.Resource, 1, i));
|
||||||
|
}
|
||||||
|
for (int i = 0; i < ORES.length; i++) {
|
||||||
|
OreDictionary.registerOre(ORES[i], new ItemStack(BlockHandler.BlockBase, 1, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,91 +1,16 @@
|
||||||
package mysticores.util;
|
package mysticores.util;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import mysticores.MysticOres;
|
|
||||||
import mysticores.blocks.BlockHandler;
|
import mysticores.blocks.BlockHandler;
|
||||||
import mysticores.items.Items;
|
import mysticores.items.Items;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class RecipeManager {
|
public class RecipeManager {
|
||||||
private static HashMap<Object,ItemStack> agateConverted = new HashMap<Object, ItemStack>();
|
|
||||||
static{
|
|
||||||
agateConverted.put("stone",new ItemStack(net.minecraft.init.Items.slime_ball,8));
|
|
||||||
agateConverted.put(new ItemStack(Blocks.sand),new ItemStack(Blocks.grass,8));
|
|
||||||
agateConverted.put(new ItemStack(net.minecraft.init.Items.reeds),new ItemStack(net.minecraft.init.Items.wheat,16));
|
|
||||||
agateConverted.put(new ItemStack(net.minecraft.init.Items.slime_ball),new ItemStack(Blocks.cactus,32));
|
|
||||||
agateConverted.put("shardGlass",new ItemStack(net.minecraft.init.Items.flint,8));
|
|
||||||
agateConverted.put("plankWood",new ItemStack(Blocks.bookshelf,8));
|
|
||||||
agateConverted.put("stickWood",new ItemStack(net.minecraft.init.Items.leather,8));
|
|
||||||
agateConverted.put(new ItemStack(Blocks.dirt),new ItemStack(BlockHandler.BlockBase, 8, 7));
|
|
||||||
agateConverted.put(new ItemStack(net.minecraft.init.Items.egg),new ItemStack(net.minecraft.init.Items.wheat_seeds, 32));
|
|
||||||
agateConverted.put(new ItemStack(Blocks.gravel),new ItemStack(Blocks.coal_ore,8));
|
|
||||||
agateConverted.put(new ItemStack(net.minecraft.init.Items.wheat_seeds),new ItemStack(Blocks.deadbush, 8));
|
|
||||||
agateConverted.put(new ItemStack(Blocks.glass),new ItemStack(Blocks.wool,8,0));
|
|
||||||
agateConverted.put(new ItemStack(net.minecraft.init.Items.iron_ingot),new ItemStack(Items.Resource, 16, 0));
|
|
||||||
agateConverted.put("oreGold",new ItemStack(BlockHandler.BlockBase, 16, 7));
|
|
||||||
agateConverted.put("cobblestone",new ItemStack(Blocks.mossy_cobblestone, 8, 0));
|
|
||||||
agateConverted.put("treeSapling",new ItemStack(net.minecraft.init.Items.wheat_seeds,16,0));
|
|
||||||
}
|
|
||||||
private static HashMap<Object,ItemStack> amethystConverted = new HashMap<Object, ItemStack>();
|
|
||||||
static{
|
|
||||||
amethystConverted.put(new ItemStack(net.minecraft.init.Items.egg), new ItemStack(net.minecraft.init.Items.cookie, 8));
|
|
||||||
amethystConverted.put("plankWood", new ItemStack(Blocks.noteblock, 8));
|
|
||||||
amethystConverted.put("shardObsidian", new ItemStack(Items.Resource, 8, 4));
|
|
||||||
amethystConverted.put("stickWood", new ItemStack(Items.Resource, 8, 13));
|
|
||||||
amethystConverted.put(new ItemStack(Blocks.dirt), new ItemStack(Blocks.iron_ore, 8));
|
|
||||||
amethystConverted.put(new ItemStack(Blocks.brick_block), new ItemStack(Blocks.tnt, 8));
|
|
||||||
amethystConverted.put("treeSapling", new ItemStack(Blocks.leaves, 16));
|
|
||||||
amethystConverted.put("oreRedstone", new ItemStack(Blocks.diamond_ore, 4));
|
|
||||||
amethystConverted.put(new ItemStack(net.minecraft.init.Items.slime_ball), new ItemStack(net.minecraft.init.Items.cake));
|
|
||||||
amethystConverted.put(new ItemStack(Blocks.glass), new ItemStack(Blocks.lit_pumpkin, 8));
|
|
||||||
amethystConverted.put("shardGlass", new ItemStack(Items.Resource, 8, 12));
|
|
||||||
amethystConverted.put("stone", new ItemStack(Blocks.monster_egg, 8));
|
|
||||||
amethystConverted.put(new ItemStack(Blocks.lapis_block), new ItemStack(net.minecraft.init.Items.diamond, 8));
|
|
||||||
amethystConverted.put(new ItemStack(Blocks.sand), new ItemStack(Blocks.gold_ore, 16));
|
|
||||||
amethystConverted.put(new ItemStack(net.minecraft.init.Items.reeds), new ItemStack(net.minecraft.init.Items.book, 8));
|
|
||||||
}
|
|
||||||
private static HashMap<Object, ItemStack> tourmalineConverted = new HashMap<Object, ItemStack>();
|
|
||||||
static{
|
|
||||||
tourmalineConverted.put(new ItemStack(Blocks.sand), new ItemStack(Blocks.glass, 16));
|
|
||||||
tourmalineConverted.put("oreCoal", new ItemStack(Blocks.lapis_ore, 8));
|
|
||||||
tourmalineConverted.put(new ItemStack(net.minecraft.init.Items.egg), new ItemStack(net.minecraft.init.Items.sugar, 16));
|
|
||||||
tourmalineConverted.put(new ItemStack(net.minecraft.init.Items.wheat_seeds), new ItemStack(Blocks.brown_mushroom, 8));
|
|
||||||
tourmalineConverted.put(new ItemStack(Blocks.glass), new ItemStack(Blocks.snow_layer, 8));
|
|
||||||
tourmalineConverted.put("stone", new ItemStack(Blocks.glass, 8));
|
|
||||||
tourmalineConverted.put(new ItemStack(Blocks.iron_block), new ItemStack(Blocks.lapis_block, 8));
|
|
||||||
tourmalineConverted.put("plankWood", new ItemStack(Blocks.sandstone, 16));
|
|
||||||
tourmalineConverted.put("stickWood", new ItemStack(net.minecraft.init.Items.string, 8));
|
|
||||||
tourmalineConverted.put(new ItemStack(Blocks.snow), new ItemStack(Blocks.ice, 8));
|
|
||||||
tourmalineConverted.put("treeSapling", new ItemStack(net.minecraft.init.Items.reeds, 8));
|
|
||||||
tourmalineConverted.put(new ItemStack(Blocks.dirt), new ItemStack(Blocks.snow, 8));
|
|
||||||
tourmalineConverted.put(new ItemStack(net.minecraft.init.Items.reeds), new ItemStack(net.minecraft.init.Items.snowball, 16));
|
|
||||||
tourmalineConverted.put(new ItemStack(net.minecraft.init.Items.slime_ball), new ItemStack(net.minecraft.init.Items.clay_ball, 16));
|
|
||||||
}
|
|
||||||
private static HashMap<Object, ItemStack> topazeConverted = new HashMap<Object, ItemStack>();
|
|
||||||
static{
|
|
||||||
topazeConverted.put("stone", new ItemStack(Blocks.sandstone, 16));
|
|
||||||
topazeConverted.put(new ItemStack(Blocks.iron_block), new ItemStack(Blocks.gold_block, 8));
|
|
||||||
topazeConverted.put(new ItemStack(Blocks.sand), new ItemStack(Blocks.sponge, 8));
|
|
||||||
topazeConverted.put("oreLapis", new ItemStack(Blocks.redstone_ore, 8));
|
|
||||||
topazeConverted.put(new ItemStack(net.minecraft.init.Items.egg), new ItemStack(net.minecraft.init.Items.feather, 32));
|
|
||||||
topazeConverted.put(new ItemStack(net.minecraft.init.Items.wheat), new ItemStack(Blocks.red_mushroom, 8));
|
|
||||||
topazeConverted.put(new ItemStack(Blocks.glass), new ItemStack(Blocks.glowstone, 8));
|
|
||||||
topazeConverted.put("shardObsidian", new ItemStack(Items.Resource, 16, 11));
|
|
||||||
topazeConverted.put("cobblestone", new ItemStack(Blocks.netherrack, 16));
|
|
||||||
topazeConverted.put("treeSapling", new ItemStack(Blocks.log, 16));
|
|
||||||
topazeConverted.put(new ItemStack(Blocks.dirt), new ItemStack(Blocks.iron_ore, 8));
|
|
||||||
topazeConverted.put(new ItemStack(net.minecraft.init.Items.reeds), new ItemStack(net.minecraft.init.Items.apple, 1));
|
|
||||||
topazeConverted.put("shardGlass", new ItemStack(net.minecraft.init.Items.arrow, 32));
|
|
||||||
topazeConverted.put("plankWood", new ItemStack(Blocks.wooden_door, 8));
|
|
||||||
topazeConverted.put("stickWood", new ItemStack(net.minecraft.init.Items.bone, 8));
|
|
||||||
}
|
|
||||||
public static void initialize() {
|
public static void initialize() {
|
||||||
recipes();
|
recipes();
|
||||||
toolRecipes();
|
toolRecipes();
|
||||||
|
|
@ -94,108 +19,92 @@ public class RecipeManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void powderRecipes() {
|
private static void powderRecipes() {
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.gold_ore, 2), MysticOres.INGOTS[9], "oreGold"));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreGold, 2), OreDictManager.INGOTS[9], "oreGold"));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.iron_ore, 2), MysticOres.INGOTS[9], "oreIron"));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreIron, 2), OreDictManager.INGOTS[9], "oreIron"));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 2, 10), MysticOres.INGOTS[9], MysticOres.INGOTS[10]));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 2, 10), OreDictManager.INGOTS[9], OreDictManager.INGOTS[10]));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(net.minecraft.init.Items.gunpowder, 2), MysticOres.INGOTS[9], net.minecraft.init.Items.gunpowder));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.gunpowder, 2), OreDictManager.INGOTS[9], Item.gunpowder));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 2, 4), MysticOres.INGOTS[9], MysticOres.INGOTS[4]));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 2, 4), OreDictManager.INGOTS[9], OreDictManager.INGOTS[4]));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.coal_ore, 2), MysticOres.INGOTS[9], "oreCoal"));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreCoal, 2), OreDictManager.INGOTS[9], Block.oreCoal));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.iron_ore, 3), MysticOres.INGOTS[9], "oreIron"));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreIron, 3), OreDictManager.INGOTS[9], "oreIron"));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.gold_ore, 3), MysticOres.INGOTS[9], "oreGold"));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreGold, 3), OreDictManager.INGOTS[9], "oreGold"));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.redstone_ore, 2), MysticOres.INGOTS[9], "oreRedstone"));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreRedstone, 2), OreDictManager.INGOTS[9], "oreRedstone"));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.lapis_ore, 2), MysticOres.INGOTS[9], "oreLapis"));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreLapis, 2), OreDictManager.INGOTS[9], "oreLapis"));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.diamond_ore, 2), MysticOres.INGOTS[9], "oreDiamond"));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreDiamond, 2), OreDictManager.INGOTS[9], "oreDiamond"));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(net.minecraft.init.Items.sugar, 18), MysticOres.INGOTS[9], net.minecraft.init.Items.sugar));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.sugar, 18), OreDictManager.INGOTS[9], Item.sugar));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(net.minecraft.init.Items.redstone, 12), MysticOres.INGOTS[9], net.minecraft.init.Items.redstone));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.redstone, 12), OreDictManager.INGOTS[9], Item.redstone));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(net.minecraft.init.Items.glowstone_dust, 6), MysticOres.INGOTS[9], net.minecraft.init.Items.glowstone_dust));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.glowstone, 6), OreDictManager.INGOTS[9], Item.glowstone));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(net.minecraft.init.Items.gunpowder, 3), MysticOres.INGOTS[9], net.minecraft.init.Items.gunpowder));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.gunpowder, 3), OreDictManager.INGOTS[9], Item.gunpowder));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void recipes() {
|
private static void recipes() {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.glass, 1), "##", "##", '#', MysticOres.INGOTS[11]));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Block.glass, 1), "##", "##", '#', OreDictManager.INGOTS[11]));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.obsidian, 1), "##", "##", '#', MysticOres.INGOTS[12]));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Block.obsidian, 1), "##", "##", '#', OreDictManager.INGOTS[12]));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 7), "XXX", "XOX", "XXX", 'X', Blocks.dirt, 'O',
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 7), "XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'),
|
||||||
MysticOres.INGOTS[6]));
|
OreDictManager.INGOTS[6]));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 16, 7), "XXX", "XOX", "XXX", 'X', MysticOres.ORES[3], 'O',
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 16, 7), "XXX", "XOX", "XXX", Character.valueOf('X'), OreDictManager.ORES[3], Character.valueOf('O'),
|
||||||
MysticOres.INGOTS[6]));
|
OreDictManager.INGOTS[6]));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 3), "XXX", "XOX", "XXX", 'X', Blocks.dirt, 'O',
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 3), "XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'),
|
||||||
MysticOres.INGOTS[8]));
|
OreDictManager.INGOTS[8]));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 12), "###", "#D#", "###", '#', MysticOres.INGOTS[11], 'D', MysticOres.INGOTS[12]));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 12), "###", "#D#", "###", '#', OreDictManager.INGOTS[11], 'D', OreDictManager.INGOTS[12]));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 1, 7), "##", "##", '#', MysticOres.INGOTS[10]));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 1, 7), "##", "##", '#', OreDictManager.INGOTS[10]));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(BlockHandler.BlockBase, 2, 7), MysticOres.INGOTS[9], MysticOres.ORES[7]));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(BlockHandler.BlockBase, 2, 7), OreDictManager.INGOTS[9], OreDictManager.ORES[7]));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(BlockHandler.BlockBase, 2, 3), MysticOres.INGOTS[9], MysticOres.ORES[3]));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(BlockHandler.BlockBase, 2, 3), OreDictManager.INGOTS[9], OreDictManager.ORES[3]));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(BlockHandler.BlockBase, 2, 0), MysticOres.INGOTS[9], MysticOres.ORES[0]));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(BlockHandler.BlockBase, 2, 0), OreDictManager.INGOTS[9], OreDictManager.ORES[0]));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Resource, 2, 13), "#", "#", '#', MysticOres.INGOTS[12]));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Resource, 2, 13), "#", "#", '#', OreDictManager.INGOTS[12]));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Resource, 1, 3), "###", "#O#", "###", '#', MysticOres.INGOTS[4], 'O', MysticOres.INGOTS[2]));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Resource, 1, 3), "###", "#O#", "###", '#', OreDictManager.INGOTS[4], 'O', OreDictManager.INGOTS[2]));
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 11), Blocks.glass);
|
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 11), Block.glass);
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 12), Blocks.obsidian);
|
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 12), Block.obsidian);
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 8, 9), MysticOres.INGOTS[5], MysticOres.INGOTS[7], MysticOres.INGOTS[8], MysticOres.INGOTS[6]));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 8, 9), OreDictManager.INGOTS[5], OreDictManager.INGOTS[7], OreDictManager.INGOTS[8], OreDictManager.INGOTS[6]));
|
||||||
for(Map.Entry<Object,ItemStack> entry:agateConverted.entrySet()){
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(entry.getValue(), "###", "#o#", "###", 'o', "gemAgate", '#', entry.getKey()));
|
|
||||||
}
|
|
||||||
for(Map.Entry<Object,ItemStack> entry:amethystConverted.entrySet()){
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(entry.getValue(), "###", "#o#", "###", 'o', "gemAmethyst", '#', entry.getKey()));
|
|
||||||
}
|
|
||||||
for(Map.Entry<Object,ItemStack> entry:tourmalineConverted.entrySet()){
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(entry.getValue(), "###", "#o#", "###", 'o', "gemTourmaline", '#', entry.getKey()));
|
|
||||||
}
|
|
||||||
for(Map.Entry<Object,ItemStack> entry:topazeConverted.entrySet()){
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(entry.getValue(), "###", "#o#", "###", 'o', "gemTopaz", '#', entry.getKey()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void smelting() {
|
private static void smelting() {
|
||||||
smeltBlockIntoResource(6, 0, 0.4F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 6, new ItemStack(Items.Resource, 1, 0), 0.4F);
|
||||||
smeltBlockIntoResource(3, 1, 0.7F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 3, new ItemStack(Items.Resource, 1, 1), 0.7F);
|
||||||
smeltBlockIntoResource(0, 2, 0.9F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 0, new ItemStack(Items.Resource, 1, 2), 0.9F);
|
||||||
smeltBlockIntoResource(2, 4, 0.4F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 2, new ItemStack(Items.Resource, 1, 4), 0.4F);
|
||||||
smeltBlockIntoResource(4, 5, 0.4F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 4, new ItemStack(Items.Resource, 1, 5), 0.4F);
|
||||||
smeltBlockIntoResource(11, 6, 0.4F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 11, new ItemStack(Items.Resource, 1, 6), 0.4F);
|
||||||
smeltBlockIntoResource(5, 7, 0.4F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 5, new ItemStack(Items.Resource, 1, 7), 0.4F);
|
||||||
smeltBlockIntoResource(1, 8, 0.4F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 1, new ItemStack(Items.Resource, 1, 8), 0.4F);
|
||||||
smeltBlockIntoResource(7, 10, 0.4F);
|
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 7, new ItemStack(Items.Resource, 1, 10), 0.4F);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void smeltBlockIntoResource(int metaInput, int metaOutput, float exp){
|
|
||||||
FurnaceRecipes.smelting().func_151394_a(new ItemStack(BlockHandler.BlockBase,1, metaInput), new ItemStack(Items.Resource, 1, metaOutput), exp);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void toolRecipes() {
|
private static void toolRecipes() {
|
||||||
ToolRecipes.sword(Items.VerditeSword, MysticOres.INGOTS[0]);
|
ToolRecipes.SwordRecipe(Items.VerditeSword, OreDictManager.INGOTS[0]);
|
||||||
ToolRecipes.pickaxe(Items.VerditePickaxe, MysticOres.INGOTS[0]);
|
ToolRecipes.PickaxeRecipe(Items.VerditePickaxe, OreDictManager.INGOTS[0]);
|
||||||
ToolRecipes.shovel(Items.VerditeShovel, MysticOres.INGOTS[0]);
|
ToolRecipes.ShovelRecipe(Items.VerditeShovel, OreDictManager.INGOTS[0]);
|
||||||
ToolRecipes.axe(Items.VerditeAxe, MysticOres.INGOTS[0]);
|
ToolRecipes.AxeRecipe(Items.VerditeAxe, OreDictManager.INGOTS[0]);
|
||||||
ToolRecipes.hoe(Items.VerditeHoe, MysticOres.INGOTS[0]);
|
ToolRecipes.HoeRecipe(Items.VerditeHoe, OreDictManager.INGOTS[0]);
|
||||||
ToolRecipes.sword(Items.MithrilSword, MysticOres.INGOTS[1]);
|
ToolRecipes.SwordRecipe(Items.MithrilSword, OreDictManager.INGOTS[1]);
|
||||||
ToolRecipes.pickaxe(Items.MithrilPickaxe, MysticOres.INGOTS[1]);
|
ToolRecipes.PickaxeRecipe(Items.MithrilPickaxe, OreDictManager.INGOTS[1]);
|
||||||
ToolRecipes.shovel(Items.MithrilShovel, MysticOres.INGOTS[1]);
|
ToolRecipes.ShovelRecipe(Items.MithrilShovel, OreDictManager.INGOTS[1]);
|
||||||
ToolRecipes.axe(Items.MithrilAxe, MysticOres.INGOTS[1]);
|
ToolRecipes.AxeRecipe(Items.MithrilAxe, OreDictManager.INGOTS[1]);
|
||||||
ToolRecipes.hoe(Items.MithrilHoe, MysticOres.INGOTS[1]);
|
ToolRecipes.HoeRecipe(Items.MithrilHoe, OreDictManager.INGOTS[1]);
|
||||||
ToolRecipes.advancedSword(Items.AdamantineSword, MysticOres.INGOTS[2]);
|
ToolRecipes.AdvancedSwordRecipe(Items.AdamantineSword, OreDictManager.INGOTS[2]);
|
||||||
ToolRecipes.advancedPickaxe(Items.AdamantinePickaxe, MysticOres.INGOTS[2]);
|
ToolRecipes.AdvancedPickaxeRecipe(Items.AdamantinePickaxe, OreDictManager.INGOTS[2]);
|
||||||
ToolRecipes.advancedShovel(Items.AdamantineShovel, MysticOres.INGOTS[2]);
|
ToolRecipes.AdvancedShovelRecipe(Items.AdamantineShovel, OreDictManager.INGOTS[2]);
|
||||||
ToolRecipes.advancedAxe(Items.AdamantineAxe, MysticOres.INGOTS[2]);
|
ToolRecipes.AdvancedAxeRecipe(Items.AdamantineAxe, OreDictManager.INGOTS[2]);
|
||||||
ToolRecipes.advancedHoe(Items.AdamantineHoe, MysticOres.INGOTS[2]);
|
ToolRecipes.AdvancedHoeRecipe(Items.AdamantineHoe, OreDictManager.INGOTS[2]);
|
||||||
ToolRecipes.advancedSword(Items.IridiumSword, MysticOres.INGOTS[3]);
|
ToolRecipes.AdvancedSwordRecipe(Items.IridiumSword, OreDictManager.INGOTS[3]);
|
||||||
ToolRecipes.advancedPickaxe(Items.IridiumPickaxe, MysticOres.INGOTS[3]);
|
ToolRecipes.AdvancedPickaxeRecipe(Items.IridiumPickaxe, OreDictManager.INGOTS[3]);
|
||||||
ToolRecipes.advancedShovel(Items.IridiumShovel, MysticOres.INGOTS[3]);
|
ToolRecipes.AdvancedShovelRecipe(Items.IridiumShovel, OreDictManager.INGOTS[3]);
|
||||||
ToolRecipes.advancedAxe(Items.IridiumAxe, MysticOres.INGOTS[3]);
|
ToolRecipes.AdvancedAxeRecipe(Items.IridiumAxe, OreDictManager.INGOTS[3]);
|
||||||
ToolRecipes.advancedHoe(Items.IridiumHoe, MysticOres.INGOTS[3]);
|
ToolRecipes.AdvancedHoeRecipe(Items.IridiumHoe, OreDictManager.INGOTS[3]);
|
||||||
ToolRecipes.advancedSword(Items.IridiumSword, MysticOres.INGOTS[3]);
|
ToolRecipes.AdvancedSwordRecipe(Items.IridiumSword, OreDictManager.INGOTS[3]);
|
||||||
ToolRecipes.advancedPickaxe(Items.IridiumPickaxe, MysticOres.INGOTS[3]);
|
ToolRecipes.AdvancedPickaxeRecipe(Items.IridiumPickaxe, OreDictManager.INGOTS[3]);
|
||||||
ToolRecipes.advancedShovel(Items.IridiumShovel, MysticOres.INGOTS[3]);
|
ToolRecipes.AdvancedShovelRecipe(Items.IridiumShovel, OreDictManager.INGOTS[3]);
|
||||||
ToolRecipes.advancedAxe(Items.IridiumAxe, MysticOres.INGOTS[3]);
|
ToolRecipes.AdvancedAxeRecipe(Items.IridiumAxe, OreDictManager.INGOTS[3]);
|
||||||
ToolRecipes.advancedHoe(Items.IridiumHoe, MysticOres.INGOTS[3]);
|
ToolRecipes.AdvancedHoeRecipe(Items.IridiumHoe, OreDictManager.INGOTS[3]);
|
||||||
ToolRecipes.advancedSword(Items.ObsidianSword, new ItemStack(Blocks.obsidian));
|
ToolRecipes.AdvancedSwordRecipe(Items.ObsidianSword, new ItemStack(Block.obsidian));
|
||||||
ToolRecipes.advancedPickaxe(Items.ObsidianPickaxe, new ItemStack(Blocks.obsidian));
|
ToolRecipes.AdvancedPickaxeRecipe(Items.ObsidianPickaxe, new ItemStack(Block.obsidian));
|
||||||
ToolRecipes.advancedShovel(Items.ObsidianShovel, new ItemStack(Blocks.obsidian));
|
ToolRecipes.AdvancedShovelRecipe(Items.ObsidianShovel, new ItemStack(Block.obsidian));
|
||||||
ToolRecipes.advancedAxe(Items.ObsidianAxe, new ItemStack(Blocks.obsidian));
|
ToolRecipes.AdvancedAxeRecipe(Items.ObsidianAxe, new ItemStack(Block.obsidian));
|
||||||
ToolRecipes.advancedHoe(Items.ObsidianHoe, new ItemStack(Blocks.obsidian));
|
ToolRecipes.AdvancedHoeRecipe(Items.ObsidianHoe, new ItemStack(Block.obsidian));
|
||||||
ToolRecipes.advancedSword(Items.BloodstoneSword, MysticOres.ORES[7]);
|
ToolRecipes.AdvancedSwordRecipe(Items.BloodstoneSword, OreDictManager.ORES[7]);
|
||||||
ToolRecipes.advancedPickaxe(Items.BloodstonePickaxe, MysticOres.ORES[7]);
|
ToolRecipes.AdvancedPickaxeRecipe(Items.BloodstonePickaxe, OreDictManager.ORES[7]);
|
||||||
ToolRecipes.advancedShovel(Items.BloodstoneShovel, MysticOres.ORES[7]);
|
ToolRecipes.AdvancedShovelRecipe(Items.BloodstoneShovel, OreDictManager.ORES[7]);
|
||||||
ToolRecipes.advancedAxe(Items.BloodstoneAxe, MysticOres.ORES[7]);
|
ToolRecipes.AdvancedAxeRecipe(Items.BloodstoneAxe, OreDictManager.ORES[7]);
|
||||||
ToolRecipes.advancedHoe(Items.BloodstoneHoe, MysticOres.ORES[7]);
|
ToolRecipes.AdvancedHoeRecipe(Items.BloodstoneHoe, OreDictManager.ORES[7]);
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Satchel, 1), "#$#", "$%$", "#$#", '#', net.minecraft.init.Items.string, '$', MysticOres.INGOTS[9], '%', Blocks.ender_chest));
|
GameRegistry.addRecipe(new ItemStack(Items.Satchel, 1), "#$#", "$%$", "#$#", '#', Item.silk, '$', OreDictManager.INGOTS[9], '%', Block.enderChest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
common/MysticOres/Util/TabMysticOres.java
Normal file
16
common/MysticOres/Util/TabMysticOres.java
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
package mysticores.util;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class TabMysticOres extends CreativeTabs {
|
||||||
|
public TabMysticOres(String par2Str) {
|
||||||
|
super(par2Str);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getIconItemStack() {
|
||||||
|
return new ItemStack(BlockHandler.BlockBase, 1, 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,53 +1,52 @@
|
||||||
package mysticores.util;
|
package mysticores.util;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import mysticores.MysticOres;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class ToolRecipes {
|
public class ToolRecipes {
|
||||||
public static void advancedAxe(Item output, Object input) {
|
public static void AdvancedAxeRecipe(Item output, Object input) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "#S ", " S ", 'S', MysticOres.INGOTS[13], '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "#S ", " S ", 'S', OreDictManager.INGOTS[13], '#', input));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "S# ", "S ", 'S', MysticOres.INGOTS[13], '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "S# ", "S ", 'S', OreDictManager.INGOTS[13], '#', input));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void advancedHoe(Item output, Object input) {
|
public static void AdvancedHoeRecipe(Item output, Object input) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", " S ", " S ", 'S', MysticOres.INGOTS[13], '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", " S ", " S ", 'S', OreDictManager.INGOTS[13], '#', input));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "S ", "S ", 'S', MysticOres.INGOTS[13], '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "S ", "S ", 'S', OreDictManager.INGOTS[13], '#', input));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void advancedPickaxe(Item output, Object input) {
|
public static void AdvancedPickaxeRecipe(Item output, Object input) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "###", " S ", " S ", 'S', MysticOres.INGOTS[13], '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "###", " S ", " S ", 'S', OreDictManager.INGOTS[13], '#', input));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void advancedShovel(Item output, Object input) {
|
public static void AdvancedShovelRecipe(Item output, Object input) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "S", "S", 'S', MysticOres.INGOTS[13], '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "S", "S", 'S', OreDictManager.INGOTS[13], '#', input));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void advancedSword(Item output, Object input) {
|
public static void AdvancedSwordRecipe(Item output, Object input) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "#", "S", 'S', MysticOres.INGOTS[13], '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "#", "S", 'S', OreDictManager.INGOTS[13], '#', input));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void axe(Item output, Object input) {
|
public static void AxeRecipe(Item output, Object input) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "#S ", " S ", 'S', "stickWood", '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "#S ", " S ", 'S', "stickWood", '#', input));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "S# ", "S ", 'S', "stickWood", '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "S# ", "S ", 'S', "stickWood", '#', input));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void hoe(Item output, Object input) {
|
public static void HoeRecipe(Item output, Object input) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", " S ", " S ", 'S', "stickWood", '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", " S ", " S ", 'S', "stickWood", '#', input));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "S ", "S ", 'S', "stickWood", '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "## ", "S ", "S ", 'S', "stickWood", '#', input));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void pickaxe(Item output, Object input) {
|
public static void PickaxeRecipe(Item output, Object input) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "###", " S ", " S ", 'S', "stickWood", '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "###", " S ", " S ", 'S', "stickWood", '#', input));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void shovel(Item output, Object input) {
|
public static void ShovelRecipe(Item output, Object input) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "S", "S", 'S', "stickWood", '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "S", "S", 'S', "stickWood", '#', input));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sword(Item output, Object input) {
|
public static void SwordRecipe(Item output, Object input) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "#", "S", 'S', "stickWood", '#', input));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "#", "S", 'S', "stickWood", '#', input));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
15
common/MysticOres/Worldgen/GeneratorManager.java
Normal file
15
common/MysticOres/Worldgen/GeneratorManager.java
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
package mysticores.worldgen;
|
||||||
|
|
||||||
|
import mysticores.blocks.BlockHandler;
|
||||||
|
import mysticores.lib.Rarity;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
|
public class GeneratorManager {
|
||||||
|
public static void initialize() {
|
||||||
|
GameRegistry.registerWorldGenerator(new WorldGenOres());
|
||||||
|
GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 7, Rarity.BLOODSTONE + 1));
|
||||||
|
GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 8, Rarity.BLACKSOULSTONE + 1));
|
||||||
|
GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 9, Rarity.BLUESOULSTONE + 1));
|
||||||
|
GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 10, Rarity.REDSOULSTONE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,24 +1,23 @@
|
||||||
package mysticores.worldgen;
|
package mysticores.worldgen;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
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 java.util.Random;
|
|
||||||
|
|
||||||
public class NetherGenHelper extends WorldGenerator {
|
public class NetherGenHelper extends WorldGenerator {
|
||||||
private Block minableBlockId;
|
private int minableBlockId;
|
||||||
private int minableBlockMeta = 0;
|
private int minableBlockMeta = 0;
|
||||||
private int numberOfBlocks;
|
private int numberOfBlocks;
|
||||||
|
|
||||||
public NetherGenHelper(Block par1, int par2) {
|
public NetherGenHelper(int par1, int par2) {
|
||||||
this.minableBlockId = par1;
|
this.minableBlockId = par1;
|
||||||
this.numberOfBlocks = par2;
|
this.numberOfBlocks = par2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NetherGenHelper(Block id, int meta, int number) {
|
public NetherGenHelper(int id, int meta, int number) {
|
||||||
this(id, number);
|
this(id, number);
|
||||||
minableBlockMeta = meta;
|
minableBlockMeta = meta;
|
||||||
}
|
}
|
||||||
|
|
@ -53,8 +52,8 @@ public class NetherGenHelper extends WorldGenerator {
|
||||||
if (var39 * var39 + var42 * var42 < 1.0D) {
|
if (var39 * var39 + var42 * var42 < 1.0D) {
|
||||||
for (int var44 = var34; var44 <= var37; ++var44) {
|
for (int var44 = var34; var44 <= var37; ++var44) {
|
||||||
double var45 = (var44 + 0.5D - var24) / (var28 / 2.0D);
|
double var45 = (var44 + 0.5D - var24) / (var28 / 2.0D);
|
||||||
Block blocktoreplace = par1World.getBlock(var38, var41, var44);
|
int blocktoreplace = par1World.getBlockId(var38, var41, var44);
|
||||||
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && blocktoreplace == Blocks.netherrack) {
|
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && blocktoreplace == Block.netherrack.blockID) {
|
||||||
par1World.setBlock(var38, var41, var44, this.minableBlockId, minableBlockMeta, 3);
|
par1World.setBlock(var38, var41, var44, this.minableBlockId, minableBlockMeta, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
35
common/MysticOres/Worldgen/NetherGenMineable.java
Normal file
35
common/MysticOres/Worldgen/NetherGenMineable.java
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
package mysticores.worldgen;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||||
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
|
public class NetherGenMineable implements IWorldGenerator {
|
||||||
|
private WorldGenerator helper;
|
||||||
|
|
||||||
|
public NetherGenMineable(int blockId, int numBlocks) {
|
||||||
|
helper = new NetherGenHelper(blockId, numBlocks);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NetherGenMineable(int blockId, int meta, int numBlocks) {
|
||||||
|
helper = new NetherGenHelper(blockId, meta, numBlocks);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
|
if (world.provider.isHellWorld)
|
||||||
|
generateNether(world, random, chunkX * 16, chunkZ * 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void generateNether(World world, Random random, int i, int j) {
|
||||||
|
for (int j1 = 0; j1 < 50; j1++) {
|
||||||
|
int Xcoordinate = i + random.nextInt(16);
|
||||||
|
int Zcoordinate = j + random.nextInt(16);
|
||||||
|
int Ycoordinate = random.nextInt(256);
|
||||||
|
helper.generate(world, random, Xcoordinate, Ycoordinate, Zcoordinate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,175 +1,37 @@
|
||||||
package mysticruins;
|
package mysticruins;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameData;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.WeightedRandom;
|
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
|
||||||
import net.minecraftforge.common.BiomeDictionary;
|
|
||||||
import net.minecraftforge.common.BiomeDictionary.Type;
|
|
||||||
import net.minecraftforge.common.DungeonHooks.DungeonMob;
|
|
||||||
import net.minecraftforge.common.config.Configuration;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.Configuration;
|
||||||
|
|
||||||
public class Config {
|
public class Config {
|
||||||
public static Configuration config;
|
public static Configuration config;
|
||||||
public static int RuinRarity;
|
public static int RuinRarity;
|
||||||
public static int DunRarity;
|
public static int DunRarity;
|
||||||
public static Set<Integer>[] allowId = new HashSet[4];
|
public static List<Integer> ruinAllowId = new ArrayList();
|
||||||
public static final String[] allows = { "Ruin allowed dimension id", "Dungeon allowed dimension id", "Ruin allowed biome id", "Dungeon allowed biome id" };
|
public static List<Integer> dungeonAllowId = new ArrayList();
|
||||||
public static Set<Type>[] allowType = new HashSet[2];
|
|
||||||
public static List<DungeonMob> dungeonMobs = new ArrayList<DungeonMob>();
|
|
||||||
public static final String commonItems = "iron_pickaxe,iron_axe,iron_sword,iron_shovel,gold_ingot,iron_ingot";
|
|
||||||
public static final String rareItems = "ender_pearl:4,diamond,emerald,golden_apple,gold_ingot,iron_ingot";
|
|
||||||
|
|
||||||
public static void addDungeonMob(String name, int rarity) {
|
|
||||||
for (DungeonMob mob : dungeonMobs) {
|
|
||||||
if (name.equals(mob.type)) {
|
|
||||||
mob.itemWeight += rarity;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dungeonMobs.add(new DungeonMob(rarity, name));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getRandomDungeonMob(Random rand) {
|
|
||||||
DungeonMob mob = (DungeonMob) WeightedRandom.getRandomItem(rand, dungeonMobs);
|
|
||||||
if (mob == null) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return mob.type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void initialize(File file) {
|
public static void initialize(File file) {
|
||||||
config = new Configuration(file);
|
config = new Configuration(file);
|
||||||
MysticRuins.ENABLE = config.get("General", "Enable", true).getBoolean(true);
|
config.load();
|
||||||
String[] mobs = config.get("DungeonMobs", "Spawner Type & Relative Chance", "Skeleton-50,Spider-50,Zombie-20,Cavepider-10,Blaze-1", "MobName-RelativeWeight").getString().split(",");
|
RuinRarity = config.get("General", "Ruin Rarity", 2).getInt();
|
||||||
String[] mob;
|
DunRarity = config.get("General", "Mystic Dungeon Rarity", 1).getInt();
|
||||||
for (String txt : mobs) {
|
String[] ID = config.get("General", "Ruin allowed dimension id", "0,").getString().split(",");
|
||||||
mob = txt.split("-");
|
for (String txt : ID) {
|
||||||
if (mob.length == 2) {
|
|
||||||
try {
|
|
||||||
addDungeonMob(mob[0].trim(), Integer.parseInt(mob[1].trim()));
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setChest("Common Items", commonItems, ChestFiller.valuables);
|
|
||||||
setChest("Rare Items", rareItems, ChestFiller.rares);
|
|
||||||
StringBuilder build = new StringBuilder("Available biome tags are: ");
|
|
||||||
for (Type t : Type.values()) {
|
|
||||||
build.append(t);
|
|
||||||
build.append(",");
|
|
||||||
}
|
|
||||||
config.addCustomCategoryComment("General", build.toString());
|
|
||||||
RuinRarity = config.get("General", "Ruin Rarity", 200, "Chance per chunk : lower to make rarer").getInt();
|
|
||||||
DunRarity = config.get("General", "Mystic Dungeon Rarity", 100, "Chance per chunk : lower to make rarer").getInt();
|
|
||||||
String[] ID;
|
|
||||||
for (int i = 0; i < allows.length; i++) {
|
|
||||||
ID = config
|
|
||||||
.get("General", allows[i], i < 2 ? "0,[2;10]" : "ALL,-WATER",
|
|
||||||
i < 2 ? "Use [id1;id2] to add a range of id, prefix with - to exclude" : "Use ALL or * for all biomes, select with biome id or biome tags, prefix with - to exclude")
|
|
||||||
.getString().split(",");
|
|
||||||
allowId[i] = new HashSet<Integer>();
|
|
||||||
if (i > 1) {
|
|
||||||
allowType[i - 2] = new HashSet<Type>();
|
|
||||||
}
|
|
||||||
for (String txt : ID) {
|
|
||||||
if (i > 1 && txt.startsWith("-")) {
|
|
||||||
txt = txt.substring(1).trim();
|
|
||||||
try {
|
|
||||||
allowId[i].remove(Integer.parseInt(txt));
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
try {
|
|
||||||
allowType[i - 2].remove(Type.valueOf(txt.toUpperCase()));
|
|
||||||
} catch (IllegalArgumentException l) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (i < 2 && txt.contains("[") && txt.contains("]")) {
|
|
||||||
boolean remove = txt.trim().startsWith("-");
|
|
||||||
String[] results = txt.substring(txt.indexOf("[")+1, txt.indexOf("]")).split(";");
|
|
||||||
if (results.length == 2) {
|
|
||||||
try {
|
|
||||||
int a = Integer.parseInt(results[0]);
|
|
||||||
int b = Integer.parseInt(results[1]);
|
|
||||||
int c;
|
|
||||||
if (a > b) {
|
|
||||||
c = a;
|
|
||||||
a = b;
|
|
||||||
b = c;
|
|
||||||
}
|
|
||||||
for (int x = a; x <= b; x++) {
|
|
||||||
if (remove) {
|
|
||||||
allowId[i].remove(x);
|
|
||||||
} else {
|
|
||||||
allowId[i].add(x);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException n) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
int j = Integer.parseInt(txt.trim());
|
|
||||||
allowId[i].add(j);
|
|
||||||
if (i > 1) {
|
|
||||||
allowType[i - 2].addAll(Arrays.asList(BiomeDictionary.getTypesForBiome(BiomeGenBase.getBiomeGenArray()[j])));
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
if (i > 1) {
|
|
||||||
if (txt.equals("*") || txt.equalsIgnoreCase("ALL")) {
|
|
||||||
for (int j = 0; j < BiomeGenBase.getBiomeGenArray().length; j++) {
|
|
||||||
allowId[i].add(j);
|
|
||||||
}
|
|
||||||
for (Type t : Type.values()) {
|
|
||||||
allowType[i - 2].add(t);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
Type type = Type.valueOf(txt.toUpperCase());
|
|
||||||
allowType[i - 2].add(type);
|
|
||||||
for (BiomeGenBase biome : BiomeDictionary.getBiomesForType(type)) {
|
|
||||||
allowId[i].add(biome.biomeID);
|
|
||||||
}
|
|
||||||
} catch (IllegalArgumentException l) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(config.hasChanged())
|
|
||||||
config.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void setChest(String type, String list, List<ItemStack> valuables) {
|
|
||||||
String[] items = config.get("Chests", type, list, "itemname:stacksize:damage").getString().split(",");
|
|
||||||
String[] item;
|
|
||||||
for (String txt : items) {
|
|
||||||
item = txt.split(":");
|
|
||||||
Item id;
|
|
||||||
int amount = 1, data = 0;
|
|
||||||
try {
|
try {
|
||||||
switch (item.length) {
|
ruinAllowId.add(Integer.parseInt(txt.trim()));
|
||||||
case 3:
|
} catch (NumberFormatException e) {
|
||||||
data = Integer.parseInt(item[2]);
|
|
||||||
case 2:
|
|
||||||
amount = Integer.parseInt(item[1]);
|
|
||||||
case 1:
|
|
||||||
id = GameData.itemRegistry.get(item[0]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException n) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (id != null && amount > 0 && data >= 0) {
|
|
||||||
valuables.add(new ItemStack(id, amount, data));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ID = config.get("General", "Dungeon allowed dimension id", "0,").getString().split(",");
|
||||||
|
for (String txt : ID) {
|
||||||
|
try {
|
||||||
|
dungeonAllowId.add(Integer.parseInt(txt.trim()));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
config.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,13 +5,11 @@ import cpw.mods.fml.common.Mod.EventHandler;
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
@Mod(modid = "mysticruins", name = "Mystic Ruins", version = "0.1")
|
@Mod(modid = "MysticRuins", name = "Mystic Ruins", version = "0.1")
|
||||||
public final class MysticRuins {
|
public class MysticRuins {
|
||||||
public static boolean ENABLE = true;
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent event) {
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
Config.initialize(event.getSuggestedConfigurationFile());
|
Config.initialize(event.getSuggestedConfigurationFile());
|
||||||
if(ENABLE)
|
GameRegistry.registerWorldGenerator(new WorldGenMystic());
|
||||||
GameRegistry.registerWorldGenerator(new WorldGenMystic(), 20);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,431 +1,435 @@
|
||||||
package mysticruins;
|
package mysticruins;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||||
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 net.minecraftforge.common.DungeonHooks;
|
import net.minecraftforge.common.DungeonHooks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class StructureRuin$1 extends WorldGenerator {
|
public class StructureRuin$1 extends WorldGenerator {
|
||||||
public StructureRuin$1() {
|
public StructureRuin$1() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean generate(World world, Random random, int i, int j, int k) {
|
public boolean generate(World world, Random random, int i, int j, int k) {
|
||||||
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
|
int l = random.nextInt(100);
|
||||||
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
|
if (l >= 10) {
|
||||||
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
|
|
||||||
if (k1 <= 0) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!world.isAirBlock(j1, k1, l1) || world.getBlock(j1, k1 - 1, l1) != Blocks.grass || !Blocks.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) {
|
for (int i1 = 0; i1 < 1; i1++) {
|
||||||
return false;
|
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
|
||||||
}
|
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
|
||||||
int i2 = random.nextInt(3) + 1;
|
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
|
||||||
if (i2 == 1) {
|
if (!world.isAirBlock(j1, k1, l1) || world.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || !Block.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) {
|
||||||
int i3 = random.nextInt(8) + 5;
|
continue;
|
||||||
int l3 = random.nextInt(8) + 5;
|
|
||||||
int k4 = random.nextInt(4) + 3;
|
|
||||||
int j8 = random.nextInt(100);
|
|
||||||
int j5;
|
|
||||||
if (j8 <= 20) {
|
|
||||||
j5 = 0;
|
|
||||||
} else {
|
|
||||||
j5 = random.nextInt(4) + 5;
|
|
||||||
}
|
}
|
||||||
setBlock(world, j1, k1 - j5, l1, Blocks.stonebrick);
|
int i2 = random.nextInt(3) + 1;
|
||||||
setBlock(world, j1, (k1 - j5) + 2, l1, Blocks.stonebrick);
|
if (i2 == 1) {
|
||||||
setBlock(world, j1, (k1 - j5) + 4, l1 + 1, Blocks.stonebrick);
|
int j2 = random.nextInt(8) + 5;
|
||||||
setBlock(world, j1, (k1 - j5) + 3, l1 + 2, Blocks.stonebrick);
|
int i3 = random.nextInt(8) + 5;
|
||||||
setBlock(world, j1, (k1 - j5) + 1, l1 + 3, Blocks.stonebrick);
|
int l3 = random.nextInt(8) + 5;
|
||||||
setBlock(world, j1, (k1 - j5) + 2, l1 + 3, Blocks.stonebrick);
|
int k4 = random.nextInt(4) + 3;
|
||||||
setBlockAndMetadata(world, j1, k1 - j5, l1 + 3, Blocks.stonebrick, 1);
|
int j5 = 1;
|
||||||
setBlockAndMetadata(world, j1, (k1 - j5) + 1, l1, Blocks.stonebrick, 1);
|
int i6 = 0;
|
||||||
setBlockAndMetadata(world, j1, (k1 - j5) + 2, l1 + 1, Blocks.stonebrick, 1);
|
int l6 = 1;
|
||||||
setBlockAndMetadata(world, j1, (k1 - j5) + 3, l1 + 1, Blocks.stonebrick, 1);
|
boolean flag = false;
|
||||||
setBlockAndMetadata(world, j1, (k1 - j5) + 5, l1 + 1, Blocks.stonebrick, 1);
|
int k7 = random.nextInt(100);
|
||||||
setBlockAndMetadata(world, j1, (k1 - j5) + 2, l1 + 2, Blocks.stonebrick, 1);
|
int j8 = random.nextInt(100);
|
||||||
setBlockAndMetadata(world, j1, (k1 - j5) + 4, l1 + 2, Blocks.stonebrick, 1);
|
if (j8 <= 20) {
|
||||||
setBlock(world, j1, k1 - j5 - k4 - 1, l1 + 2, Blocks.dirt);
|
j5 = 0;
|
||||||
setBlock(world, j1, k1 - j5 - k4, l1 + 2, Blocks.chest);
|
|
||||||
ChestFiller.fillWithValuables(world.getTileEntity(j1, k1 - j5 - k4, l1 + 2));
|
|
||||||
int l6 = 1;
|
|
||||||
int i6 = 0;
|
|
||||||
boolean flag = false;
|
|
||||||
do {
|
|
||||||
if (world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6)
|
|
||||||
|| world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) == Blocks.water || world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) == Blocks.water
|
|
||||||
|| world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) == Blocks.water) {
|
|
||||||
i6++;
|
|
||||||
} else {
|
} else {
|
||||||
flag = true;
|
j5 = random.nextInt(4) + 5;
|
||||||
}
|
}
|
||||||
} while (!flag && l6++ < 12);
|
world.setBlock(j1, k1 - j5, l1, Block.stoneBrick.blockID);
|
||||||
setBlock(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick);
|
world.setBlock(j1, (k1 - j5) + 1, l1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 + l3 + 2, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick);
|
world.setBlock(j1, (k1 - j5) + 2, l1, Block.stoneBrick.blockID);
|
||||||
setBlock(world, j1 + l3 + 5, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick);
|
world.setBlock(j1, (k1 - j5) + 2, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 5, Blocks.stonebrick);
|
world.setBlock(j1, (k1 - j5) + 3, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 7, Blocks.stonebrick);
|
world.setBlock(j1, (k1 - j5) + 4, l1 + 1, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Blocks.stonebrick, 1);
|
world.setBlock(j1, (k1 - j5) + 5, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 + l3 + 1, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick, 1);
|
world.setBlock(j1, (k1 - j5) + 2, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 + l3 + 1, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Blocks.stonebrick, 1);
|
world.setBlock(j1, (k1 - j5) + 3, l1 + 2, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 + l3 + 3, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick, 1);
|
world.setBlock(j1, (k1 - j5) + 4, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 + l3 + 4, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick, 1);
|
world.setBlock(j1, k1 - j5, l1 + 3, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 5, Blocks.stonebrick, 1);
|
world.setBlock(j1, (k1 - j5) + 1, l1 + 3, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 6, Blocks.stonebrick, 1);
|
world.setBlock(j1, (k1 - j5) + 2, l1 + 3, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 3) - i6, l1 + l3 + 6, Blocks.stonebrick, 1);
|
world.setBlock(j1, k1 - j5 - k4 - 1, l1 + 2, Block.dirt.blockID);
|
||||||
setBlockAndMetadata(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 7, Blocks.stonebrick, 1);
|
world.setBlock(j1, k1 - j5 - k4, l1 + 2, Block.chest.blockID);
|
||||||
setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 7, Blocks.stonebrick, 1);
|
ChestFiller.fillWithValuables(world.getBlockTileEntity(j1, k1 - j5 - k4, l1 + 2));
|
||||||
int k7 = random.nextInt(100);
|
l6 = 1;
|
||||||
if (k7 <= 30) {
|
i6 = 0;
|
||||||
setBlock(world, j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Blocks.mob_spawner);
|
flag = false;
|
||||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5);
|
do {
|
||||||
if (spawner != null) {
|
if (world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6)
|
||||||
spawner.func_145881_a().setEntityName(DungeonHooks.getRandomDungeonMob(random));
|
|| world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) == Block.waterStill.blockID
|
||||||
|
|| world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) == Block.waterStill.blockID) {
|
||||||
|
i6++;
|
||||||
|
} else {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
} while (!flag && l6++ < 12);
|
||||||
|
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + l3 + 1, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + l3 + 1, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + l3 + 2, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + l3 + 3, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + l3 + 4, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + l3 + 5, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 5, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 6, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 3) - i6, l1 + l3 + 6, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 7, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 7, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 7, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
k7 = random.nextInt(100);
|
||||||
|
if (k7 <= 30) {
|
||||||
|
world.setBlock(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Block.mobSpawner.blockID);
|
||||||
|
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5);
|
||||||
|
if (spawner != null) {
|
||||||
|
spawner.getSpawnerLogic().setMobID(DungeonHooks.getRandomDungeonMob(random));
|
||||||
|
}
|
||||||
|
world.setBlock(j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Block.dirt.blockID);
|
||||||
|
}
|
||||||
|
l6 = 1;
|
||||||
|
i6 = 0;
|
||||||
|
flag = false;
|
||||||
|
do {
|
||||||
|
if (world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 4) || world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 5) || world.isAirBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5)
|
||||||
|
|| world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID
|
||||||
|
|| world.getBlockId(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID) {
|
||||||
|
i6++;
|
||||||
|
} else {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
} while (!flag && l6++ < 12);
|
||||||
|
world.setBlock(j1 - i3, k1 - j5 - i6, l1 - 4, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 - i3, ((k1 - j5) + 1) - i6, l1 - 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - i3, k1 - j5 - i6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - i3 - 1, k1 - j5 - i6, l1 - 5, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 - i3 - 1, ((k1 - j5) + 1) - i6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - i3 - 1, ((k1 - j5) + 2) - i6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - i3 - 2, k1 - j5 - i6, l1 - 5, Block.stoneBrick.blockID);
|
||||||
|
k7 = random.nextInt(100);
|
||||||
|
if (k7 <= 60) {
|
||||||
|
world.setBlock(j1 - i3 - 1, k1 - j5 - i6 - k4, l1 - 5, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 - i3 - 1, k1 - j5 - i6 - k4 - 1, l1 - 5, Block.dirt.blockID);
|
||||||
}
|
}
|
||||||
setBlock(world, j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Blocks.dirt);
|
|
||||||
}
|
}
|
||||||
l6 = 1;
|
if (i2 == 2) {
|
||||||
i6 = 0;
|
int k2 = random.nextInt(8) + 5;
|
||||||
flag = false;
|
int j3 = random.nextInt(8) + 5;
|
||||||
do {
|
int i4 = random.nextInt(8) + 5;
|
||||||
if (world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 4) || world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 5) || world.isAirBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5)
|
int l4 = random.nextInt(4) + 3;
|
||||||
|| world.getBlock(j1 - i3, k1 - j5 - l6, l1 - 4) == Blocks.water || world.getBlock(j1 - i3, k1 - j5 - l6, l1 - 5) == Blocks.water
|
int k5 = 1;
|
||||||
|| world.getBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Blocks.water) {
|
int j6 = 0;
|
||||||
i6++;
|
int i7 = 1;
|
||||||
|
boolean flag1 = false;
|
||||||
|
int l7 = random.nextInt(100);
|
||||||
|
int k8 = random.nextInt(100);
|
||||||
|
if (k8 <= 20) {
|
||||||
|
k5 = 0;
|
||||||
} else {
|
} else {
|
||||||
flag = true;
|
k5 = random.nextInt(4) + 5;
|
||||||
|
}
|
||||||
|
world.setBlock(j1, k1 - k5, l1, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1, k1 - k5, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1, k1 - k5, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1, k1 - k5, l1 + 3, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1, k1 - k5, l1 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1, (k1 - k5) + 1, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1, (k1 - k5) + 2, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1, (k1 - k5) + 3, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1, (k1 - k5) + 1, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + 1, k1 - k5, l1, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + 2, k1 - k5, l1, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1, k1 - k5 - l4, l1 + 2, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1, k1 - k5 - l4 - 1, l1 + 2, Block.dirt.blockID);
|
||||||
|
i7 = 1;
|
||||||
|
j6 = 0;
|
||||||
|
flag1 = false;
|
||||||
|
do {
|
||||||
|
if (world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 4) || world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 5) || world.isAirBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5)
|
||||||
|
|| world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID
|
||||||
|
|| world.getBlockId(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID) {
|
||||||
|
j6++;
|
||||||
|
} else {
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
} while (!flag1 && i7++ < 12);
|
||||||
|
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 3, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 1) - j6, l1 - 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 2) - j6, l1 - 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 1) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 2) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 3) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 4) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - k2 - 1, k1 - k5 - j6, l1 - 5, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 - k2 - 1, ((k1 - k5) + 1) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - k2 - 1, ((k1 - k5) + 2) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - k2 - 2, k1 - k5 - j6, l1 - 5, Block.stoneBrick.blockID);
|
||||||
|
l7 = random.nextInt(100);
|
||||||
|
if (l7 <= 30) {
|
||||||
|
world.setBlock(j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Block.dirt.blockID);
|
||||||
|
}
|
||||||
|
i7 = 1;
|
||||||
|
j6 = 0;
|
||||||
|
flag1 = false;
|
||||||
|
do {
|
||||||
|
if (world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 4) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 6) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 8)
|
||||||
|
|| world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 6) == Block.waterStill.blockID
|
||||||
|
|| world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 8) == Block.waterStill.blockID) {
|
||||||
|
j6++;
|
||||||
|
} else {
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
} while (!flag1 && i7++ < 12);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + i4 + 1, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + i4 + 1, ((k1 - k5) + 1) - j6, l1 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + i4 + 2, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + i4 + 3, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + i4 + 3, ((k1 - k5) + 1) - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + i4 + 4, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + i4 + 5, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 5, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 2) - j6, l1 + 6, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 7, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 7, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 2) - j6, l1 + 7, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 8, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 8, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 9, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
l7 = random.nextInt(100);
|
||||||
|
if (l7 <= 60) {
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6 - l4, l1 + 7, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6 - l4 - 1, l1 + 7, Block.dirt.blockID);
|
||||||
|
}
|
||||||
|
i7 = 1;
|
||||||
|
j6 = 0;
|
||||||
|
flag1 = false;
|
||||||
|
do {
|
||||||
|
if (world.isAirBlock(j1 - j3, k1 - k5 - i7, l1 + i4) || world.isAirBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) || world.isAirBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4)
|
||||||
|
|| world.getBlockId(j1 - j3, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID || world.getBlockId(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Block.waterStill.blockID
|
||||||
|
|| world.getBlockId((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID) {
|
||||||
|
j6++;
|
||||||
|
} else {
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
} while (!flag1 && i7++ < 12);
|
||||||
|
world.setBlock((j1 - j3) + 1, k1 - k5 - j6, l1 + i4, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock((j1 - j3) + 1, ((k1 - k5) + 1) - j6, l1 + i4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock((j1 - j3) + 1, ((k1 - k5) + 2) - j6, l1 + i4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock((j1 - j3) + 2, k1 - k5 - j6, l1 + i4, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - j3, k1 - k5 - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 5) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 - j3, k1 - k5 - j6, (l1 + i4) - 3, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 3, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 3, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 3, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
l7 = random.nextInt(100);
|
||||||
|
if (l7 <= 30) {
|
||||||
|
world.setBlock(j1 - j3, k1 - k5 - j6 - l4, (l1 + i4) - 2, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 - j3, k1 - k5 - j6 - l4 - 1, (l1 + i4) - 2, Block.dirt.blockID);
|
||||||
|
}
|
||||||
|
i7 = 1;
|
||||||
|
j6 = 0;
|
||||||
|
flag1 = false;
|
||||||
|
do {
|
||||||
|
if (world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) || world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) || world.isAirBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7)
|
||||||
|
|| world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Block.waterStill.blockID || world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID
|
||||||
|
|| world.getBlockId(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID) {
|
||||||
|
j6++;
|
||||||
|
} else {
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
} while (!flag1 && i7++ < 12);
|
||||||
|
world.setBlock(j1 + j3 + 4, k1 - k5 - j6, l1 - 6, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 6, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 2) - j6, l1 - 6, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + j3 + 4, k1 - k5 - j6, l1 - 7, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 7, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + j3 + 5, k1 - k5 - j6, l1 - 7, Block.stoneBrick.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 5, ((k1 - k5) + 1) - j6, l1 - 7, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + j3 + 5, ((k1 - k5) + 2) - j6, l1 - 7, Block.stoneBrick.blockID, 1, 2);
|
||||||
|
world.setBlock(j1 + j3 + 6, k1 - k5 - j6, l1 - 7, Block.stoneBrick.blockID);
|
||||||
|
l7 = random.nextInt(100);
|
||||||
|
if (l7 <= 30) {
|
||||||
|
world.setBlock(j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Block.dirt.blockID);
|
||||||
}
|
}
|
||||||
} while (!flag && l6++ < 12);
|
|
||||||
setBlock(world, j1 - i3, k1 - j5 - i6, l1 - 4, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 - i3, ((k1 - j5) + 1) - i6, l1 - 4, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - i3, k1 - j5 - i6, l1 - 5, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 - i3 - 1, k1 - j5 - i6, l1 - 5, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 - i3 - 1, ((k1 - j5) + 1) - i6, l1 - 5, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - i3 - 1, ((k1 - j5) + 2) - i6, l1 - 5, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 - i3 - 2, k1 - j5 - i6, l1 - 5, Blocks.stonebrick);
|
|
||||||
k7 = random.nextInt(100);
|
|
||||||
if (k7 <= 60) {
|
|
||||||
setBlock(world, j1 - i3 - 1, k1 - j5 - i6 - k4, l1 - 5, Blocks.dirt);
|
|
||||||
setBlock(world, j1 - i3 - 1, k1 - j5 - i6 - k4 - 1, l1 - 5, Blocks.dirt);
|
|
||||||
}
|
}
|
||||||
}
|
if (i2 != 3) {
|
||||||
if (i2 == 2) {
|
continue;
|
||||||
int k2 = random.nextInt(8) + 5;
|
}
|
||||||
int j3 = random.nextInt(8) + 5;
|
int l2 = random.nextInt(8) + 5;
|
||||||
int i4 = random.nextInt(8) + 5;
|
int k3 = random.nextInt(8) + 5;
|
||||||
int l4 = random.nextInt(4) + 3;
|
int j4 = random.nextInt(8) + 5;
|
||||||
int k8 = random.nextInt(100);
|
int i5 = random.nextInt(4) + 3;
|
||||||
int k5;
|
int l5 = 1;
|
||||||
if (k8 <= 20) {
|
int k6 = 0;
|
||||||
k5 = 0;
|
int j7 = 1;
|
||||||
|
boolean flag2 = false;
|
||||||
|
int i8 = random.nextInt(100);
|
||||||
|
int l8 = random.nextInt(100);
|
||||||
|
if (l8 <= 20) {
|
||||||
|
l5 = 0;
|
||||||
} else {
|
} else {
|
||||||
k5 = random.nextInt(4) + 5;
|
l5 = random.nextInt(4) + 5;
|
||||||
}
|
}
|
||||||
setBlock(world, j1, k1 - k5, l1, Blocks.stonebrick);
|
world.setBlock(j1, k1 - l5, l1, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1, k1 - k5, l1 + 1, Blocks.stonebrick, 1);
|
world.setBlock(j1 - 1, k1 - l5, l1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1, k1 - k5, l1 + 2, Blocks.stonebrick, 1);
|
world.setBlock(j1 - 1, (k1 - l5) + 1, l1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1, k1 - k5, l1 + 3, Blocks.stonebrick, 1);
|
world.setBlock(j1 - 1, (k1 - l5) + 2, l1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1, k1 - k5, l1 + 4, Blocks.stonebrick, 1);
|
world.setBlock(j1 - 1, (k1 - l5) + 3, l1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1, (k1 - k5) + 1, l1 + 2, Blocks.stonebrick, 1);
|
world.setBlock(j1, (k1 - l5) + 1, l1, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1, (k1 - k5) + 2, l1 + 2, Blocks.stonebrick, 1);
|
world.setBlock(j1, (k1 - l5) + 2, l1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1, (k1 - k5) + 3, l1 + 2, Blocks.stonebrick, 1);
|
world.setBlock(j1, (k1 - l5) + 3, l1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1, (k1 - k5) + 1, l1 + 1, Blocks.stonebrick, 1);
|
world.setBlock(j1, (k1 - l5) + 4, l1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 + 1, k1 - k5, l1, Blocks.stonebrick, 1);
|
world.setBlock(j1, (k1 - l5) + 5, l1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 + 2, k1 - k5, l1, Blocks.stonebrick, 1);
|
world.setBlock(j1, k1 - l5, l1 + 1, Block.stoneBrick.blockID);
|
||||||
setBlock(world, j1, k1 - k5 - l4, l1 + 2, Blocks.dirt);
|
world.setBlock(j1, (k1 - l5) + 2, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1, k1 - k5 - l4 - 1, l1 + 2, Blocks.dirt);
|
world.setBlock(j1, k1 - l5, l1 + 2, Block.stoneBrick.blockID);
|
||||||
int i7 = 1;
|
world.setBlock(j1, (k1 - l5) + 1, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
int j6 = 0;
|
world.setBlock(j1, k1 - l5 - i5, l1 + 1, Block.dirt.blockID);
|
||||||
boolean flag1 = false;
|
world.setBlock(j1, k1 - l5 - i5 - 1, l1 + 1, Block.dirt.blockID);
|
||||||
|
j7 = 1;
|
||||||
|
k6 = 0;
|
||||||
|
flag2 = false;
|
||||||
do {
|
do {
|
||||||
if (world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 4) || world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 5) || world.isAirBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5)
|
if (world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4)
|
||||||
|| world.getBlock(j1 - k2, k1 - k5 - i7, l1 - 4) == Blocks.water || world.getBlock(j1 - k2, k1 - k5 - i7, l1 - 5) == Blocks.water
|
|| world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Block.waterStill.blockID
|
||||||
|| world.getBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Blocks.water) {
|
|| world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Block.waterStill.blockID
|
||||||
j6++;
|
|| world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Block.waterStill.blockID) {
|
||||||
|
k6++;
|
||||||
} else {
|
} else {
|
||||||
flag1 = true;
|
flag2 = true;
|
||||||
}
|
}
|
||||||
} while (!flag1 && i7++ < 12);
|
} while (!flag2 && j7++ < 12);
|
||||||
setBlock(world, j1 - k2, k1 - k5 - j6, l1 - 3, Blocks.stonebrick);
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 - k2, k1 - k5 - j6, l1 - 4, Blocks.stonebrick, 1);
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 1) - j6, l1 - 4, Blocks.stonebrick, 1);
|
world.setBlock(j1 + k3 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 2) - j6, l1 - 4, Blocks.stonebrick, 1);
|
world.setBlock(j1 + k3 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 - k2, k1 - k5 - j6, l1 - 5, Blocks.stonebrick, 1);
|
world.setBlock(j1 + k3 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 1) - j6, l1 - 5, Blocks.stonebrick, 1);
|
world.setBlock(j1 + k3 + l2 + 3, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 2) - j6, l1 - 5, Blocks.stonebrick, 1);
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 1, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 3) - j6, l1 - 5, Blocks.stonebrick, 1);
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 4) - j6, l1 - 5, Blocks.stonebrick, 1);
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 - k2 - 1, k1 - k5 - j6, l1 - 5, Blocks.stonebrick);
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 3) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 - k2 - 1, ((k1 - k5) + 1) - j6, l1 - 5, Blocks.stonebrick, 1);
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 2, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 - k2 - 1, ((k1 - k5) + 2) - j6, l1 - 5, Blocks.stonebrick, 1);
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 - k2 - 2, k1 - k5 - j6, l1 - 5, Blocks.stonebrick);
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 3, Block.stoneBrick.blockID);
|
||||||
int l7 = random.nextInt(100);
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 3, Block.stoneBrick.blockID, 1, 2);
|
||||||
if (l7 <= 30) {
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 4, Block.stoneBrick.blockID);
|
||||||
setBlock(world, j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Blocks.dirt);
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 6, Block.stoneBrick.blockID);
|
||||||
setBlock(world, j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Blocks.dirt);
|
i8 = random.nextInt(100);
|
||||||
|
if (i8 <= 30) {
|
||||||
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6 - i5, l1 + j4 + 1, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6 - i5 - 1, l1 + j4 + 1, Block.dirt.blockID);
|
||||||
}
|
}
|
||||||
i7 = 1;
|
j7 = 1;
|
||||||
j6 = 0;
|
k6 = 0;
|
||||||
flag1 = false;
|
flag2 = false;
|
||||||
do {
|
do {
|
||||||
if (world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 4) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 6) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 8)
|
if (world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) || world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) || world.isAirBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6)
|
||||||
|| world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 4) == Blocks.water || world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 6) == Blocks.water
|
|| world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) == Block.waterStill.blockID || world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) == Block.waterStill.blockID
|
||||||
|| world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 8) == Blocks.water) {
|
|| world.getBlockId(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Block.waterStill.blockID) {
|
||||||
j6++;
|
k6++;
|
||||||
} else {
|
} else {
|
||||||
flag1 = true;
|
flag2 = true;
|
||||||
}
|
}
|
||||||
} while (!flag1 && i7++ < 12);
|
} while (!flag2 && j7++ < 12);
|
||||||
setBlock(world, j1 + i4, k1 - k5 - j6, l1 + 4, Blocks.stonebrick);
|
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 1, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 4, Blocks.stonebrick, 1);
|
world.setBlock(j1 - k3, (k1 - l5 - k6) + 1, l1 - l2 - 1, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 + i4 + 1, k1 - k5 - j6, l1 + 4, Blocks.stonebrick, 1);
|
world.setBlock(j1 - k3, (k1 - l5 - k6) + 2, l1 - l2 - 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 + i4 + 1, ((k1 - k5) + 1) - j6, l1 + 4, Blocks.stonebrick, 1);
|
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 + i4 + 2, k1 - k5 - j6, l1 + 4, Blocks.stonebrick);
|
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 + i4 + 3, k1 - k5 - j6, l1 + 4, Blocks.stonebrick);
|
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 3, Block.stoneBrick.blockID);
|
||||||
setBlock(world, j1 + i4 + 3, ((k1 - k5) + 1) - j6, l1 + 4, Blocks.stonebrick);
|
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 3, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 + i4 + 4, k1 - k5 - j6, l1 + 4, Blocks.stonebrick);
|
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 + i4 + 5, k1 - k5 - j6, l1 + 4, Blocks.stonebrick);
|
world.setBlock(j1 - k3 - 1, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 + i4, k1 - k5 - j6, l1 + 5, Blocks.stonebrick, 1);
|
world.setBlock(j1 - k3 - 2, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID);
|
||||||
setBlock(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 5, Blocks.stonebrick);
|
world.setBlock(j1 - k3 - 2, ((k1 - l5) + 1) - k6, l1 - l2 - 6, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 2) - j6, l1 + 6, Blocks.stonebrick, 1);
|
world.setBlock(j1 - k3 - 3, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 + i4, k1 - k5 - j6, l1 + 7, Blocks.stonebrick, 1);
|
i8 = random.nextInt(100);
|
||||||
setBlock(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 7, Blocks.stonebrick);
|
if (i8 <= 60) {
|
||||||
setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 2) - j6, l1 + 7, Blocks.stonebrick, 1);
|
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Block.dirt.blockID);
|
||||||
setBlock(world, j1 + i4, k1 - k5 - j6, l1 + 8, Blocks.stonebrick);
|
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, Block.dirt.blockID);
|
||||||
setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 8, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 + i4, k1 - k5 - j6, l1 + 9, Blocks.stonebrick, 1);
|
|
||||||
l7 = random.nextInt(100);
|
|
||||||
if (l7 <= 60) {
|
|
||||||
setBlock(world, j1 + i4, k1 - k5 - j6 - l4, l1 + 7, Blocks.dirt);
|
|
||||||
setBlock(world, j1 + i4, k1 - k5 - j6 - l4 - 1, l1 + 7, Blocks.dirt);
|
|
||||||
}
|
}
|
||||||
i7 = 1;
|
j7 = 1;
|
||||||
j6 = 0;
|
k6 = 0;
|
||||||
flag1 = false;
|
flag2 = false;
|
||||||
do {
|
do {
|
||||||
if (world.isAirBlock(j1 - j3, k1 - k5 - i7, l1 + i4) || world.isAirBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) || world.isAirBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4)
|
if (world.isAirBlock(j1 + l2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4)
|
||||||
|| world.getBlock(j1 - j3, k1 - k5 - i7, l1 + i4) == Blocks.water || world.getBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Blocks.water
|
|| world.getBlockId(j1 + l2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID || world.getBlockId(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID
|
||||||
|| world.getBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Blocks.water) {
|
|| world.getBlockId(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID) {
|
||||||
j6++;
|
k6++;
|
||||||
} else {
|
} else {
|
||||||
flag1 = true;
|
flag2 = true;
|
||||||
}
|
}
|
||||||
} while (!flag1 && i7++ < 12);
|
} while (!flag2 && j7++ < 12);
|
||||||
setBlock(world, (j1 - j3) + 1, k1 - k5 - j6, l1 + i4, Blocks.stonebrick);
|
world.setBlock(j1 + l2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, (j1 - j3) + 1, ((k1 - k5) + 1) - j6, l1 + i4, Blocks.stonebrick, 1);
|
world.setBlock(j1 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, (j1 - j3) + 1, ((k1 - k5) + 2) - j6, l1 + i4, Blocks.stonebrick, 1);
|
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, (j1 - j3) + 2, k1 - k5 - j6, l1 + i4, Blocks.stonebrick, 1);
|
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 - j3, k1 - k5 - j6, (l1 + i4) - 1, Blocks.stonebrick, 1);
|
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 3) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 1, Blocks.stonebrick, 1);
|
world.setBlock(j1 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 1, Blocks.stonebrick, 1);
|
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||||
setBlock(world, j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 1, Blocks.stonebrick);
|
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 1, Blocks.stonebrick, 1);
|
world.setBlock(j1 + l2 + 3, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||||
setBlock(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 2, Blocks.stonebrick);
|
world.setBlock(j1 + l2 + 4, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 2, Blocks.stonebrick, 1);
|
world.setBlock(j1 + l2 + 4, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 2, Blocks.stonebrick);
|
world.setBlock(j1 + l2 + 5, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 5) - j6, (l1 + i4) - 2, Blocks.stonebrick, 1);
|
i8 = random.nextInt(100);
|
||||||
setBlock(world, j1 - j3, k1 - k5 - j6, (l1 + i4) - 3, Blocks.stonebrick);
|
if (i8 <= 30) {
|
||||||
setBlock(world, j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 3, Blocks.stonebrick);
|
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Block.dirt.blockID);
|
||||||
setBlock(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 3, Blocks.stonebrick);
|
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Block.dirt.blockID);
|
||||||
setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 3, Blocks.stonebrick, 1);
|
|
||||||
l7 = random.nextInt(100);
|
|
||||||
if (l7 <= 30) {
|
|
||||||
setBlock(world, j1 - j3, k1 - k5 - j6 - l4, (l1 + i4) - 2, Blocks.dirt);
|
|
||||||
setBlock(world, j1 - j3, k1 - k5 - j6 - l4 - 1, (l1 + i4) - 2, Blocks.dirt);
|
|
||||||
}
|
}
|
||||||
i7 = 1;
|
j7 = 1;
|
||||||
j6 = 0;
|
k6 = 0;
|
||||||
flag1 = false;
|
flag2 = false;
|
||||||
do {
|
do {
|
||||||
if (world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) || world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) || world.isAirBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7)
|
if (world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4)
|
||||||
|| world.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Blocks.water || world.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Blocks.water
|
|| world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) == Block.waterStill.blockID || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) == Block.waterStill.blockID
|
||||||
|| world.getBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Blocks.water) {
|
|| world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Block.waterStill.blockID) {
|
||||||
j6++;
|
k6++;
|
||||||
} else {
|
} else {
|
||||||
flag1 = true;
|
flag2 = true;
|
||||||
}
|
}
|
||||||
} while (!flag1 && i7++ < 12);
|
} while (!flag2 && j7++ < 12);
|
||||||
setBlock(world, j1 + j3 + 4, k1 - k5 - j6, l1 - 6, Blocks.stonebrick);
|
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 6, Blocks.stonebrick, 1);
|
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 2) - j6, l1 - 6, Blocks.stonebrick, 1);
|
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 + j3 + 4, k1 - k5 - j6, l1 - 7, Blocks.stonebrick, 1);
|
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 7, Blocks.stonebrick, 1);
|
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 + j3 + 5, k1 - k5 - j6, l1 - 7, Blocks.stonebrick);
|
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 2, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 + j3 + 5, ((k1 - k5) + 1) - j6, l1 - 7, Blocks.stonebrick, 1);
|
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 3, Block.stoneBrick.blockID);
|
||||||
setBlockAndMetadata(world, j1 + j3 + 5, ((k1 - k5) + 2) - j6, l1 - 7, Blocks.stonebrick, 1);
|
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 3, Block.stoneBrick.blockID);
|
||||||
setBlock(world, j1 + j3 + 6, k1 - k5 - j6, l1 - 7, Blocks.stonebrick);
|
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 4, Block.stoneBrick.blockID);
|
||||||
l7 = random.nextInt(100);
|
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||||
if (l7 <= 30) {
|
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 5, Block.stoneBrick.blockID, 1, 2);
|
||||||
setBlock(world, j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Blocks.dirt);
|
i8 = random.nextInt(100);
|
||||||
setBlock(world, j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Blocks.dirt);
|
if (i8 <= 30) {
|
||||||
|
world.setBlock(j1 - 3, k1 - l5 - k6 - i5 - 1, l1 + k3 + 3, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3, Block.chest.blockID);
|
||||||
|
ChestFiller.fillWithRares(world.getBlockTileEntity(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i2 != 3) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
int l2 = random.nextInt(8) + 5;
|
|
||||||
int k3 = random.nextInt(8) + 5;
|
|
||||||
int j4 = random.nextInt(8) + 5;
|
|
||||||
int i5 = random.nextInt(4) + 3;
|
|
||||||
int l8 = random.nextInt(100);
|
|
||||||
int l5;
|
|
||||||
if (l8 <= 20) {
|
|
||||||
l5 = 0;
|
|
||||||
} else {
|
|
||||||
l5 = random.nextInt(4) + 5;
|
|
||||||
}
|
|
||||||
setBlock(world, j1, k1 - l5, l1, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 - 1, k1 - l5, l1, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - 1, (k1 - l5) + 1, l1, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - 1, (k1 - l5) + 2, l1, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - 1, (k1 - l5) + 3, l1, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1, (k1 - l5) + 1, l1, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1, (k1 - l5) + 2, l1, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1, (k1 - l5) + 3, l1, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1, (k1 - l5) + 4, l1, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1, (k1 - l5) + 5, l1, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1, k1 - l5, l1 + 1, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1, (k1 - l5) + 2, l1 + 1, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1, k1 - l5, l1 + 2, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1, (k1 - l5) + 1, l1 + 2, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1, k1 - l5 - i5, l1 + 1, Blocks.dirt);
|
|
||||||
setBlock(world, j1, k1 - l5 - i5 - 1, l1 + 1, Blocks.dirt);
|
|
||||||
int j7 = 1;
|
|
||||||
int k6 = 0;
|
|
||||||
boolean flag2 = false;
|
|
||||||
do {
|
|
||||||
if (world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4)
|
|
||||||
|| world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Blocks.water || world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Blocks.water
|
|
||||||
|| world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Blocks.water) {
|
|
||||||
k6++;
|
|
||||||
} else {
|
|
||||||
flag2 = true;
|
|
||||||
}
|
|
||||||
} while (!flag2 && j7++ < 12);
|
|
||||||
setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 + k3 + l2 + 1, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 + k3 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 + k3 + l2 + 2, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 + k3 + l2 + 3, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 1, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 1, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 1, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 3) - k6, l1 + j4 + 1, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 2, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 2, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 3, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 3, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 4, Blocks.stonebrick);
|
|
||||||
setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 6, Blocks.stonebrick);
|
|
||||||
int i8 = random.nextInt(100);
|
|
||||||
if (i8 <= 30) {
|
|
||||||
setBlock(world, j1 + k3 + l2, k1 - l5 - k6 - i5, l1 + j4 + 1, Blocks.dirt);
|
|
||||||
setBlock(world, j1 + k3 + l2, k1 - l5 - k6 - i5 - 1, l1 + j4 + 1, Blocks.dirt);
|
|
||||||
}
|
|
||||||
j7 = 1;
|
|
||||||
k6 = 0;
|
|
||||||
flag2 = false;
|
|
||||||
do {
|
|
||||||
if (world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) || world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) || world.isAirBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6)
|
|
||||||
|| world.getBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) == Blocks.water || world.getBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) == Blocks.water
|
|
||||||
|| world.getBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Blocks.water) {
|
|
||||||
k6++;
|
|
||||||
} else {
|
|
||||||
flag2 = true;
|
|
||||||
}
|
|
||||||
} while (!flag2 && j7++ < 12);
|
|
||||||
setBlock(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 1, Blocks.stonebrick);
|
|
||||||
setBlock(world, j1 - k3, (k1 - l5 - k6) + 1, l1 - l2 - 1, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 - k3, (k1 - l5 - k6) + 2, l1 - l2 - 1, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 2, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 2, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 3, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 3, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 4, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - k3 - 1, k1 - l5 - k6, l1 - l2 - 6, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 - k3 - 2, k1 - l5 - k6, l1 - l2 - 6, Blocks.stonebrick);
|
|
||||||
setBlock(world, j1 - k3 - 2, ((k1 - l5) + 1) - k6, l1 - l2 - 6, Blocks.stonebrick);
|
|
||||||
setBlock(world, j1 - k3 - 3, k1 - l5 - k6, l1 - l2 - 6, Blocks.stonebrick);
|
|
||||||
i8 = random.nextInt(100);
|
|
||||||
if (i8 <= 60) {
|
|
||||||
setBlock(world, j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Blocks.dirt);
|
|
||||||
setBlock(world, j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, Blocks.dirt);
|
|
||||||
}
|
|
||||||
j7 = 1;
|
|
||||||
k6 = 0;
|
|
||||||
flag2 = false;
|
|
||||||
do {
|
|
||||||
if (world.isAirBlock(j1 + l2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4)
|
|
||||||
|| world.getBlock(j1 + l2, k1 - l5 - j7, l1 + j4) == Blocks.water || world.getBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) == Blocks.water
|
|
||||||
|| world.getBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Blocks.water) {
|
|
||||||
k6++;
|
|
||||||
} else {
|
|
||||||
flag2 = true;
|
|
||||||
}
|
|
||||||
} while (!flag2 && j7++ < 12);
|
|
||||||
setBlock(world, j1 + l2, k1 - l5 - k6, l1 + j4, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 + l2 + 1, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 + l2 + 1, ((k1 - l5) + 2) - k6, l1 + j4, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 + l2 + 1, ((k1 - l5) + 3) - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 + l2 + 2, k1 - l5 - k6, l1 + j4, Blocks.stonebrick);
|
|
||||||
setBlock(world, j1 + l2 + 2, ((k1 - l5) + 1) - k6, l1 + j4, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 + l2 + 2, ((k1 - l5) + 2) - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 + l2 + 3, ((k1 - l5) + 2) - k6, l1 + j4, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 + l2 + 4, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 + l2 + 4, ((k1 - l5) + 1) - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 + l2 + 5, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1);
|
|
||||||
i8 = random.nextInt(100);
|
|
||||||
if (i8 <= 30) {
|
|
||||||
setBlock(world, j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Blocks.dirt);
|
|
||||||
setBlock(world, j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Blocks.dirt);
|
|
||||||
}
|
|
||||||
j7 = 1;
|
|
||||||
k6 = 0;
|
|
||||||
flag2 = false;
|
|
||||||
do {
|
|
||||||
if (world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4)
|
|
||||||
|| world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) == Blocks.water || world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) == Blocks.water
|
|
||||||
|| world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Blocks.water) {
|
|
||||||
k6++;
|
|
||||||
} else {
|
|
||||||
flag2 = true;
|
|
||||||
}
|
|
||||||
} while (!flag2 && j7++ < 12);
|
|
||||||
setBlock(world, j1 - 3, k1 - l5 - k6, l1 + k3, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 1, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 2, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 2, Blocks.stonebrick, 1);
|
|
||||||
setBlock(world, j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 2, Blocks.stonebrick);
|
|
||||||
setBlock(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 3, Blocks.stonebrick);
|
|
||||||
setBlock(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 3, Blocks.stonebrick);
|
|
||||||
setBlock(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 4, Blocks.stonebrick);
|
|
||||||
setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 4, Blocks.stonebrick, 1);
|
|
||||||
setBlockAndMetadata(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 5, Blocks.stonebrick, 1);
|
|
||||||
i8 = random.nextInt(100);
|
|
||||||
if (i8 <= 30) {
|
|
||||||
setBlock(world, j1 - 3, k1 - l5 - k6 - i5 - 1, l1 + k3 + 3, Blocks.dirt);
|
|
||||||
setBlock(world, j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3, Blocks.chest);
|
|
||||||
ChestFiller.fillWithRares(world.getTileEntity(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3));
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setBlock(World w, int x, int y, int z){
|
|
||||||
func_150515_a(w, x, y, z, Blocks.air);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setBlock(World w, int x, int y, int z, Block bl){
|
|
||||||
func_150515_a(w, x, y, z, bl);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setBlockAndMetadata(World w, int x, int y, int z, Block bl, int meta){
|
|
||||||
setBlockAndNotifyAdequately(w, x, y, z, bl, meta);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,432 +1,434 @@
|
||||||
package mysticruins;
|
package mysticruins;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||||
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 net.minecraftforge.common.DungeonHooks;
|
import net.minecraftforge.common.DungeonHooks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class StructureRuin extends WorldGenerator {
|
public class StructureRuin extends WorldGenerator {
|
||||||
public StructureRuin() {
|
public StructureRuin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean generate(World world, Random random, int i, int j, int k) {
|
public boolean generate(World world, Random random, int i, int j, int k) {
|
||||||
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
|
int l = random.nextInt(100);
|
||||||
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
|
if (l >= 10) {
|
||||||
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
|
|
||||||
if (k1 <= 0) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!world.isAirBlock(j1, k1, l1) || world.getBlock(j1, k1 - 1, l1) != Blocks.grass || !Blocks.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) {
|
for (int i1 = 0; i1 < 1; i1++) {
|
||||||
return false;
|
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
|
||||||
}
|
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
|
||||||
int i2 = random.nextInt(3) + 1;
|
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
|
||||||
if (i2 == 1) {
|
if (!world.isAirBlock(j1, k1, l1) || world.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || !Block.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) {
|
||||||
int i3 = random.nextInt(8) + 5;
|
continue;
|
||||||
int l3 = random.nextInt(8) + 5;
|
|
||||||
int k4 = random.nextInt(4) + 3;
|
|
||||||
int j5;
|
|
||||||
int j8 = random.nextInt(100);
|
|
||||||
if (j8 <= 20) {
|
|
||||||
j5 = 0;
|
|
||||||
} else {
|
|
||||||
j5 = random.nextInt(4) + 5;
|
|
||||||
}
|
}
|
||||||
for (int y = k1 - j5; y < k1 - j5 + 5; y++) {
|
int i2 = random.nextInt(3) + 1;
|
||||||
if (y < k1 - j5 + 3) {
|
if (i2 == 1) {
|
||||||
setBlock(world,j1, y, l1, pickBlock(random));
|
int j2 = random.nextInt(8) + 5;
|
||||||
setBlock(world,j1, y, l1 + 3, pickBlock(random));
|
int i3 = random.nextInt(8) + 5;
|
||||||
}
|
int l3 = random.nextInt(8) + 5;
|
||||||
if (y > k1 - j5 + 1) {
|
int k4 = random.nextInt(4) + 3;
|
||||||
setBlock(world,j1, y, l1 + 1, pickBlock(random));
|
int j5 = 1;
|
||||||
setBlock(world,j1, y, l1 + 2, pickBlock(random));
|
int i6 = 0;
|
||||||
}
|
int l6 = 1;
|
||||||
}
|
boolean flag = false;
|
||||||
setBlock(world,j1, (k1 - j5) + 5, l1 + 1, pickBlock(random));
|
int k7 = random.nextInt(100);
|
||||||
setBlock(world,j1, k1 - j5 - k4 - 1, l1 + 2, Blocks.dirt);
|
int j8 = random.nextInt(100);
|
||||||
setBlock(world,j1, k1 - j5 - k4, l1 + 2, Blocks.chest);
|
if (j8 <= 20) {
|
||||||
ChestFiller.fillWithValuables(world.getTileEntity(j1, k1 - j5 - k4, l1 + 2));
|
j5 = 0;
|
||||||
int l6 = 1;
|
|
||||||
int i6 = 0;
|
|
||||||
boolean flag = false;
|
|
||||||
do {
|
|
||||||
if (world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6)
|
|
||||||
|| world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) == Blocks.water || world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) == Blocks.water
|
|
||||||
|| world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) == Blocks.water) {
|
|
||||||
i6++;
|
|
||||||
} else {
|
} else {
|
||||||
flag = true;
|
j5 = random.nextInt(4) + 5;
|
||||||
}
|
}
|
||||||
} while (!flag && l6++ < 12);
|
world.setBlock(j1, k1 - j5, l1, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + l3, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
world.setBlock(j1, (k1 - j5) + 1, l1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 4, pickBlock(random));
|
world.setBlock(j1, (k1 - j5) + 2, l1, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + l3 + 1, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
world.setBlock(j1, (k1 - j5) + 2, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + l3 + 1, ((k1 - j5) + 1) - i6, l1 + l3 + 4, pickBlock(random));
|
world.setBlock(j1, (k1 - j5) + 3, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + l3 + 2, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
world.setBlock(j1, (k1 - j5) + 4, l1 + 1, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + l3 + 3, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
world.setBlock(j1, (k1 - j5) + 5, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + l3 + 4, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
world.setBlock(j1, (k1 - j5) + 2, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + l3 + 5, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
world.setBlock(j1, (k1 - j5) + 3, l1 + 2, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + l3, k1 - j5 - i6, l1 + l3 + 5, pickBlock(random));
|
world.setBlock(j1, (k1 - j5) + 4, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 5, pickBlock(random));
|
world.setBlock(j1, k1 - j5, l1 + 3, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 6, pickBlock(random));
|
world.setBlock(j1, (k1 - j5) + 1, l1 + 3, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + l3, ((k1 - j5) + 3) - i6, l1 + l3 + 6, pickBlock(random));
|
world.setBlock(j1, (k1 - j5) + 2, l1 + 3, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + l3, k1 - j5 - i6, l1 + l3 + 7, pickBlock(random));
|
world.setBlock(j1, k1 - j5 - k4 - 1, l1 + 2, Block.dirt.blockID);
|
||||||
setBlock(world,j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 7, pickBlock(random));
|
world.setBlock(j1, k1 - j5 - k4, l1 + 2, Block.chest.blockID);
|
||||||
setBlock(world,j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 7, pickBlock(random));
|
ChestFiller.fillWithValuables(world.getBlockTileEntity(j1, k1 - j5 - k4, l1 + 2));
|
||||||
int k7 = random.nextInt(100);
|
l6 = 1;
|
||||||
if (k7 <= 30) {
|
i6 = 0;
|
||||||
setBlock(world,j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Blocks.mob_spawner);
|
flag = false;
|
||||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5);
|
do {
|
||||||
if (spawner != null) {
|
if (world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6)
|
||||||
spawner.func_145881_a().setEntityName(DungeonHooks.getRandomDungeonMob(random));
|
|| world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) == Block.waterStill.blockID
|
||||||
|
|| world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) == Block.waterStill.blockID) {
|
||||||
|
i6++;
|
||||||
|
} else {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
} while (!flag && l6++ < 12);
|
||||||
|
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + l3 + 1, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + l3 + 1, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + l3 + 2, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + l3 + 3, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + l3 + 4, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + l3 + 5, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 5, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 6, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 3) - i6, l1 + l3 + 6, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 7, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 7, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 7, Block.cobblestoneMossy.blockID);
|
||||||
|
k7 = random.nextInt(100);
|
||||||
|
if (k7 <= 30) {
|
||||||
|
world.setBlock(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Block.mobSpawner.blockID);
|
||||||
|
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5);
|
||||||
|
if (spawner != null) {
|
||||||
|
spawner.getSpawnerLogic().setMobID(DungeonHooks.getRandomDungeonMob(random));
|
||||||
|
}
|
||||||
|
world.setBlock(j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Block.dirt.blockID);
|
||||||
}
|
}
|
||||||
setBlock(world,j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Blocks.dirt);
|
l6 = 1;
|
||||||
}
|
i6 = 0;
|
||||||
l6 = 1;
|
flag = false;
|
||||||
i6 = 0;
|
do {
|
||||||
flag = false;
|
if (world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 4) || world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 5) || world.isAirBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5)
|
||||||
do {
|
|| world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID
|
||||||
if (world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 4) || world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 5) || world.isAirBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5)
|
|| world.getBlockId(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID) {
|
||||||
|| world.getBlock(j1 - i3, k1 - j5 - l6, l1 - 4) == Blocks.water || world.getBlock(j1 - i3, k1 - j5 - l6, l1 - 5) == Blocks.water
|
i6++;
|
||||||
|| world.getBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Blocks.water) {
|
} else {
|
||||||
i6++;
|
flag = true;
|
||||||
|
}
|
||||||
|
} while (!flag && l6++ < 12);
|
||||||
|
world.setBlock(j1 - i3, k1 - j5 - i6, l1 - 4, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 - i3, ((k1 - j5) + 1) - i6, l1 - 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - i3, k1 - j5 - i6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - i3 - 1, k1 - j5 - i6, l1 - 5, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 - i3 - 1, ((k1 - j5) + 1) - i6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - i3 - 1, ((k1 - j5) + 2) - i6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - i3 - 2, k1 - j5 - i6, l1 - 5, Block.cobblestone.blockID);
|
||||||
|
k7 = random.nextInt(100);
|
||||||
|
if (k7 <= 60) {
|
||||||
|
world.setBlock(j1 - i3 - 1, k1 - j5 - i6 - k4, l1 - 5, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 - i3 - 1, k1 - j5 - i6 - k4 - 1, l1 - 5, Block.dirt.blockID);
|
||||||
|
}
|
||||||
|
} else if (i2 == 2) {
|
||||||
|
int k2 = random.nextInt(8) + 5;
|
||||||
|
int j3 = random.nextInt(8) + 5;
|
||||||
|
int i4 = random.nextInt(8) + 5;
|
||||||
|
int l4 = random.nextInt(4) + 3;
|
||||||
|
int k5 = 1;
|
||||||
|
int j6 = 0;
|
||||||
|
int i7 = 1;
|
||||||
|
boolean flag1 = false;
|
||||||
|
int l7 = random.nextInt(100);
|
||||||
|
int k8 = random.nextInt(100);
|
||||||
|
if (k8 <= 20) {
|
||||||
|
k5 = 0;
|
||||||
} else {
|
} else {
|
||||||
flag = true;
|
k5 = random.nextInt(4) + 5;
|
||||||
|
}
|
||||||
|
world.setBlock(j1, k1 - k5, l1, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1, k1 - k5, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1, k1 - k5, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1, k1 - k5, l1 + 3, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1, k1 - k5, l1 + 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1, (k1 - k5) + 1, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1, (k1 - k5) + 2, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1, (k1 - k5) + 3, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1, (k1 - k5) + 1, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + 1, k1 - k5, l1, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + 2, k1 - k5, l1, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1, k1 - k5 - l4, l1 + 2, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1, k1 - k5 - l4 - 1, l1 + 2, Block.dirt.blockID);
|
||||||
|
i7 = 1;
|
||||||
|
j6 = 0;
|
||||||
|
flag1 = false;
|
||||||
|
do {
|
||||||
|
if (world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 4) || world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 5) || world.isAirBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5)
|
||||||
|
|| world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID
|
||||||
|
|| world.getBlockId(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID) {
|
||||||
|
j6++;
|
||||||
|
} else {
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
} while (!flag1 && i7++ < 12);
|
||||||
|
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 3, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 1) - j6, l1 - 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 2) - j6, l1 - 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 1) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 2) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 3) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - k2, ((k1 - k5) + 4) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - k2 - 1, k1 - k5 - j6, l1 - 5, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 - k2 - 1, ((k1 - k5) + 1) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - k2 - 1, ((k1 - k5) + 2) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - k2 - 2, k1 - k5 - j6, l1 - 5, Block.cobblestone.blockID);
|
||||||
|
l7 = random.nextInt(100);
|
||||||
|
if (l7 <= 30) {
|
||||||
|
world.setBlock(j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Block.dirt.blockID);
|
||||||
|
}
|
||||||
|
i7 = 1;
|
||||||
|
j6 = 0;
|
||||||
|
flag1 = false;
|
||||||
|
do {
|
||||||
|
if (world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 4) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 6) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 8)
|
||||||
|
|| world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 6) == Block.waterStill.blockID
|
||||||
|
|| world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 8) == Block.waterStill.blockID) {
|
||||||
|
j6++;
|
||||||
|
} else {
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
} while (!flag1 && i7++ < 12);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 4, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + i4 + 1, k1 - k5 - j6, l1 + 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + i4 + 1, ((k1 - k5) + 1) - j6, l1 + 4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + i4 + 2, k1 - k5 - j6, l1 + 4, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + i4 + 3, k1 - k5 - j6, l1 + 4, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + i4 + 3, ((k1 - k5) + 1) - j6, l1 + 4, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + i4 + 4, k1 - k5 - j6, l1 + 4, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + i4 + 5, k1 - k5 - j6, l1 + 4, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 5, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 5, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 2) - j6, l1 + 6, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 7, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 7, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 2) - j6, l1 + 7, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 8, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 8, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 9, Block.cobblestoneMossy.blockID);
|
||||||
|
l7 = random.nextInt(100);
|
||||||
|
if (l7 <= 60) {
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6 - l4, l1 + 7, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 + i4, k1 - k5 - j6 - l4 - 1, l1 + 7, Block.dirt.blockID);
|
||||||
|
}
|
||||||
|
i7 = 1;
|
||||||
|
j6 = 0;
|
||||||
|
flag1 = false;
|
||||||
|
do {
|
||||||
|
if (world.isAirBlock(j1 - j3, k1 - k5 - i7, l1 + i4) || world.isAirBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) || world.isAirBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4)
|
||||||
|
|| world.getBlockId(j1 - j3, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID || world.getBlockId(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Block.waterStill.blockID
|
||||||
|
|| world.getBlockId((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID) {
|
||||||
|
j6++;
|
||||||
|
} else {
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
} while (!flag1 && i7++ < 12);
|
||||||
|
world.setBlock((j1 - j3) + 1, k1 - k5 - j6, l1 + i4, Block.cobblestone.blockID);
|
||||||
|
world.setBlock((j1 - j3) + 1, ((k1 - k5) + 1) - j6, l1 + i4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock((j1 - j3) + 1, ((k1 - k5) + 2) - j6, l1 + i4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock((j1 - j3) + 2, k1 - k5 - j6, l1 + i4, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - j3, k1 - k5 - j6, (l1 + i4) - 1, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 1, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 1, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 1, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 1, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 2, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 2, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 2, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 5) - j6, (l1 + i4) - 2, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 - j3, k1 - k5 - j6, (l1 + i4) - 3, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 3, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 3, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 3, Block.cobblestoneMossy.blockID);
|
||||||
|
l7 = random.nextInt(100);
|
||||||
|
if (l7 <= 30) {
|
||||||
|
world.setBlock(j1 - j3, k1 - k5 - j6 - l4, (l1 + i4) - 2, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 - j3, k1 - k5 - j6 - l4 - 1, (l1 + i4) - 2, Block.dirt.blockID);
|
||||||
|
}
|
||||||
|
i7 = 1;
|
||||||
|
j6 = 0;
|
||||||
|
flag1 = false;
|
||||||
|
do {
|
||||||
|
if (world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) || world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) || world.isAirBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7)
|
||||||
|
|| world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Block.waterStill.blockID || world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID
|
||||||
|
|| world.getBlockId(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID) {
|
||||||
|
j6++;
|
||||||
|
} else {
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
} while (!flag1 && i7++ < 12);
|
||||||
|
world.setBlock(j1 + j3 + 4, k1 - k5 - j6, l1 - 6, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 6, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 2) - j6, l1 - 6, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 4, k1 - k5 - j6, l1 - 7, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 7, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 5, k1 - k5 - j6, l1 - 7, Block.cobblestone.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 5, ((k1 - k5) + 1) - j6, l1 - 7, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 5, ((k1 - k5) + 2) - j6, l1 - 7, Block.cobblestoneMossy.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 6, k1 - k5 - j6, l1 - 7, Block.cobblestone.blockID);
|
||||||
|
l7 = random.nextInt(100);
|
||||||
|
if (l7 <= 30) {
|
||||||
|
world.setBlock(j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Block.dirt.blockID);
|
||||||
}
|
}
|
||||||
} while (!flag && l6++ < 12);
|
|
||||||
setBlock(world,j1 - i3, k1 - j5 - i6, l1 - 4, pickBlock(random));
|
|
||||||
setBlock(world,j1 - i3, ((k1 - j5) + 1) - i6, l1 - 4, pickBlock(random));
|
|
||||||
setBlock(world,j1 - i3, k1 - j5 - i6, l1 - 5, pickBlock(random));
|
|
||||||
setBlock(world,j1 - i3 - 1, k1 - j5 - i6, l1 - 5, pickBlock(random));
|
|
||||||
setBlock(world,j1 - i3 - 1, ((k1 - j5) + 1) - i6, l1 - 5, pickBlock(random));
|
|
||||||
setBlock(world,j1 - i3 - 1, ((k1 - j5) + 2) - i6, l1 - 5, pickBlock(random));
|
|
||||||
setBlock(world,j1 - i3 - 2, k1 - j5 - i6, l1 - 5, pickBlock(random));
|
|
||||||
k7 = random.nextInt(100);
|
|
||||||
if (k7 <= 60) {
|
|
||||||
setBlock(world,j1 - i3 - 1, k1 - j5 - i6 - k4, l1 - 5, Blocks.dirt);
|
|
||||||
setBlock(world,j1 - i3 - 1, k1 - j5 - i6 - k4 - 1, l1 - 5, Blocks.dirt);
|
|
||||||
}
|
}
|
||||||
} else if (i2 == 2) {
|
if (i2 != 3) {
|
||||||
int k2 = random.nextInt(8) + 5;
|
continue;
|
||||||
int j3 = random.nextInt(8) + 5;
|
}
|
||||||
int i4 = random.nextInt(8) + 5;
|
int l2 = random.nextInt(8) + 5;
|
||||||
int l4 = random.nextInt(4) + 3;
|
int k3 = random.nextInt(8) + 5;
|
||||||
int k5;
|
int j4 = random.nextInt(8) + 5;
|
||||||
int k8 = random.nextInt(100);
|
int i5 = random.nextInt(4) + 3;
|
||||||
if (k8 <= 20) {
|
int l5 = 1;
|
||||||
k5 = 0;
|
int k6 = 0;
|
||||||
|
int j7 = 1;
|
||||||
|
boolean flag2 = false;
|
||||||
|
int i8 = random.nextInt(100);
|
||||||
|
int l8 = random.nextInt(100);
|
||||||
|
if (l8 <= 20) {
|
||||||
|
l5 = 0;
|
||||||
} else {
|
} else {
|
||||||
k5 = random.nextInt(4) + 5;
|
l5 = random.nextInt(4) + 5;
|
||||||
}
|
}
|
||||||
setBlock(world,j1, k1 - k5, l1, pickBlock(random));
|
world.setBlock(j1, k1 - l5, l1, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1, k1 - k5, l1 + 1, pickBlock(random));
|
world.setBlock(j1 - 1, k1 - l5, l1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1, k1 - k5, l1 + 2, pickBlock(random));
|
world.setBlock(j1 - 1, (k1 - l5) + 1, l1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1, k1 - k5, l1 + 3, pickBlock(random));
|
world.setBlock(j1 - 1, (k1 - l5) + 2, l1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1, k1 - k5, l1 + 4, pickBlock(random));
|
world.setBlock(j1 - 1, (k1 - l5) + 3, l1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1, (k1 - k5) + 1, l1 + 2, pickBlock(random));
|
world.setBlock(j1, (k1 - l5) + 1, l1, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1, (k1 - k5) + 2, l1 + 2, pickBlock(random));
|
world.setBlock(j1, (k1 - l5) + 2, l1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1, (k1 - k5) + 3, l1 + 2, pickBlock(random));
|
world.setBlock(j1, (k1 - l5) + 3, l1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1, (k1 - k5) + 1, l1 + 1, pickBlock(random));
|
world.setBlock(j1, (k1 - l5) + 4, l1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + 1, k1 - k5, l1, pickBlock(random));
|
world.setBlock(j1, (k1 - l5) + 5, l1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + 2, k1 - k5, l1, pickBlock(random));
|
world.setBlock(j1, k1 - l5, l1 + 1, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1, k1 - k5 - l4, l1 + 2, Blocks.dirt);
|
world.setBlock(j1, (k1 - l5) + 2, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1, k1 - k5 - l4 - 1, l1 + 2, Blocks.dirt);
|
world.setBlock(j1, k1 - l5, l1 + 2, Block.cobblestone.blockID);
|
||||||
int i7 = 1;
|
world.setBlock(j1, (k1 - l5) + 1, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||||
int j6 = 0;
|
world.setBlock(j1, k1 - l5 - i5, l1 + 1, Block.dirt.blockID);
|
||||||
boolean flag1 = false;
|
world.setBlock(j1, k1 - l5 - i5 - 1, l1 + 1, Block.dirt.blockID);
|
||||||
|
j7 = 1;
|
||||||
|
k6 = 0;
|
||||||
|
flag2 = false;
|
||||||
do {
|
do {
|
||||||
if (world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 4) || world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 5) || world.isAirBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5)
|
if (world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4)
|
||||||
|| world.getBlock(j1 - k2, k1 - k5 - i7, l1 - 4) == Blocks.water || world.getBlock(j1 - k2, k1 - k5 - i7, l1 - 5) == Blocks.water
|
|| world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Block.waterStill.blockID
|
||||||
|| world.getBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Blocks.water) {
|
|| world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Block.waterStill.blockID
|
||||||
j6++;
|
|| world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Block.waterStill.blockID) {
|
||||||
|
k6++;
|
||||||
} else {
|
} else {
|
||||||
flag1 = true;
|
flag2 = true;
|
||||||
}
|
}
|
||||||
} while (!flag1 && i7++ < 12);
|
} while (!flag2 && j7++ < 12);
|
||||||
setBlock(world,j1 - k2, k1 - k5 - j6, l1 - 3, pickBlock(random));
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 - k2, k1 - k5 - j6, l1 - 4, pickBlock(random));
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - k2, ((k1 - k5) + 1) - j6, l1 - 4, pickBlock(random));
|
world.setBlock(j1 + k3 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - k2, ((k1 - k5) + 2) - j6, l1 - 4, pickBlock(random));
|
world.setBlock(j1 + k3 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - k2, k1 - k5 - j6, l1 - 5, pickBlock(random));
|
world.setBlock(j1 + k3 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - k2, ((k1 - k5) + 1) - j6, l1 - 5, pickBlock(random));
|
world.setBlock(j1 + k3 + l2 + 3, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - k2, ((k1 - k5) + 2) - j6, l1 - 5, pickBlock(random));
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 1, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 - k2, ((k1 - k5) + 3) - j6, l1 - 5, pickBlock(random));
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - k2, ((k1 - k5) + 4) - j6, l1 - 5, pickBlock(random));
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - k2 - 1, k1 - k5 - j6, l1 - 5, pickBlock(random));
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 3) - k6, l1 + j4 + 1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - k2 - 1, ((k1 - k5) + 1) - j6, l1 - 5, pickBlock(random));
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 2, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 - k2 - 1, ((k1 - k5) + 2) - j6, l1 - 5, pickBlock(random));
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 2, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - k2 - 2, k1 - k5 - j6, l1 - 5, pickBlock(random));
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 3, Block.cobblestone.blockID);
|
||||||
int l7 = random.nextInt(100);
|
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 3, Block.cobblestoneMossy.blockID);
|
||||||
if (l7 <= 30) {
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 4, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Blocks.dirt);
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 6, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Blocks.dirt);
|
i8 = random.nextInt(100);
|
||||||
|
if (i8 <= 30) {
|
||||||
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6 - i5, l1 + j4 + 1, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 + k3 + l2, k1 - l5 - k6 - i5 - 1, l1 + j4 + 1, Block.dirt.blockID);
|
||||||
}
|
}
|
||||||
i7 = 1;
|
j7 = 1;
|
||||||
j6 = 0;
|
k6 = 0;
|
||||||
flag1 = false;
|
flag2 = false;
|
||||||
do {
|
do {
|
||||||
if (world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 4) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 6) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 8)
|
if (world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) || world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) || world.isAirBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6)
|
||||||
|| world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 4) == Blocks.water || world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 6) == Blocks.water
|
|| world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) == Block.waterStill.blockID || world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) == Block.waterStill.blockID
|
||||||
|| world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 8) == Blocks.water) {
|
|| world.getBlockId(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Block.waterStill.blockID) {
|
||||||
j6++;
|
k6++;
|
||||||
} else {
|
} else {
|
||||||
flag1 = true;
|
flag2 = true;
|
||||||
}
|
}
|
||||||
} while (!flag1 && i7++ < 12);
|
} while (!flag2 && j7++ < 12);
|
||||||
setBlock(world,j1 + i4, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 1, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + i4, ((k1 - k5) + 1) - j6, l1 + 4, pickBlock(random));
|
world.setBlock(j1 - k3, (k1 - l5 - k6) + 1, l1 - l2 - 1, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + i4 + 1, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
world.setBlock(j1 - k3, (k1 - l5 - k6) + 2, l1 - l2 - 1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + i4 + 1, ((k1 - k5) + 1) - j6, l1 + 4, pickBlock(random));
|
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 2, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + i4 + 2, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 2, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + i4 + 3, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 3, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + i4 + 3, ((k1 - k5) + 1) - j6, l1 + 4, pickBlock(random));
|
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 3, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + i4 + 4, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + i4 + 5, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
world.setBlock(j1 - k3 - 1, k1 - l5 - k6, l1 - l2 - 6, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + i4, k1 - k5 - j6, l1 + 5, pickBlock(random));
|
world.setBlock(j1 - k3 - 2, k1 - l5 - k6, l1 - l2 - 6, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + i4, ((k1 - k5) + 1) - j6, l1 + 5, pickBlock(random));
|
world.setBlock(j1 - k3 - 2, ((k1 - l5) + 1) - k6, l1 - l2 - 6, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + i4, ((k1 - k5) + 2) - j6, l1 + 6, pickBlock(random));
|
world.setBlock(j1 - k3 - 3, k1 - l5 - k6, l1 - l2 - 6, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + i4, k1 - k5 - j6, l1 + 7, pickBlock(random));
|
i8 = random.nextInt(100);
|
||||||
setBlock(world,j1 + i4, ((k1 - k5) + 1) - j6, l1 + 7, pickBlock(random));
|
if (i8 <= 60) {
|
||||||
setBlock(world,j1 + i4, ((k1 - k5) + 2) - j6, l1 + 7, pickBlock(random));
|
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Block.dirt.blockID);
|
||||||
setBlock(world,j1 + i4, k1 - k5 - j6, l1 + 8, pickBlock(random));
|
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, Block.dirt.blockID);
|
||||||
setBlock(world,j1 + i4, ((k1 - k5) + 1) - j6, l1 + 8, pickBlock(random));
|
|
||||||
setBlock(world,j1 + i4, k1 - k5 - j6, l1 + 9, pickBlock(random));
|
|
||||||
l7 = random.nextInt(100);
|
|
||||||
if (l7 <= 60) {
|
|
||||||
setBlock(world,j1 + i4, k1 - k5 - j6 - l4, l1 + 7, Blocks.dirt);
|
|
||||||
setBlock(world,j1 + i4, k1 - k5 - j6 - l4 - 1, l1 + 7, Blocks.dirt);
|
|
||||||
}
|
}
|
||||||
i7 = 1;
|
j7 = 1;
|
||||||
j6 = 0;
|
k6 = 0;
|
||||||
flag1 = false;
|
flag2 = false;
|
||||||
do {
|
do {
|
||||||
if (world.isAirBlock(j1 - j3, k1 - k5 - i7, l1 + i4) || world.isAirBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) || world.isAirBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4)
|
if (world.isAirBlock(j1 + l2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4)
|
||||||
|| world.getBlock(j1 - j3, k1 - k5 - i7, l1 + i4) == Blocks.water || world.getBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Blocks.water
|
|| world.getBlockId(j1 + l2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID || world.getBlockId(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID
|
||||||
|| world.getBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Blocks.water) {
|
|| world.getBlockId(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID) {
|
||||||
j6++;
|
k6++;
|
||||||
} else {
|
} else {
|
||||||
flag1 = true;
|
flag2 = true;
|
||||||
}
|
}
|
||||||
} while (!flag1 && i7++ < 12);
|
} while (!flag2 && j7++ < 12);
|
||||||
setBlock(world,(j1 - j3) + 1, k1 - k5 - j6, l1 + i4, pickBlock(random));
|
world.setBlock(j1 + l2, k1 - l5 - k6, l1 + j4, Block.cobblestone.blockID);
|
||||||
setBlock(world,(j1 - j3) + 1, ((k1 - k5) + 1) - j6, l1 + i4, pickBlock(random));
|
world.setBlock(j1 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,(j1 - j3) + 1, ((k1 - k5) + 2) - j6, l1 + i4, pickBlock(random));
|
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,(j1 - j3) + 2, k1 - k5 - j6, l1 + i4, pickBlock(random));
|
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 2) - k6, l1 + j4, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 - j3, k1 - k5 - j6, (l1 + i4) - 1, pickBlock(random));
|
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 3) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 1, pickBlock(random));
|
world.setBlock(j1 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 1, pickBlock(random));
|
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 1, pickBlock(random));
|
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 2) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 1, pickBlock(random));
|
world.setBlock(j1 + l2 + 3, ((k1 - l5) + 2) - k6, l1 + j4, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 2, pickBlock(random));
|
world.setBlock(j1 + l2 + 4, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 2, pickBlock(random));
|
world.setBlock(j1 + l2 + 4, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 2, pickBlock(random));
|
world.setBlock(j1 + l2 + 5, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 - j3, ((k1 - k5) + 5) - j6, (l1 + i4) - 2, pickBlock(random));
|
i8 = random.nextInt(100);
|
||||||
setBlock(world,j1 - j3, k1 - k5 - j6, (l1 + i4) - 3, pickBlock(random));
|
if (i8 <= 30) {
|
||||||
setBlock(world,j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 3, pickBlock(random));
|
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Block.dirt.blockID);
|
||||||
setBlock(world,j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 3, pickBlock(random));
|
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Block.dirt.blockID);
|
||||||
setBlock(world,j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 3, pickBlock(random));
|
|
||||||
l7 = random.nextInt(100);
|
|
||||||
if (l7 <= 30) {
|
|
||||||
setBlock(world,j1 - j3, k1 - k5 - j6 - l4, (l1 + i4) - 2, Blocks.dirt);
|
|
||||||
setBlock(world,j1 - j3, k1 - k5 - j6 - l4 - 1, (l1 + i4) - 2, Blocks.dirt);
|
|
||||||
}
|
}
|
||||||
i7 = 1;
|
j7 = 1;
|
||||||
j6 = 0;
|
k6 = 0;
|
||||||
flag1 = false;
|
flag2 = false;
|
||||||
do {
|
do {
|
||||||
if (world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) || world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) || world.isAirBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7)
|
if (world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4)
|
||||||
|| world.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Blocks.water || world.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Blocks.water
|
|| world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) == Block.waterStill.blockID || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) == Block.waterStill.blockID
|
||||||
|| world.getBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Blocks.water) {
|
|| world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Block.waterStill.blockID) {
|
||||||
j6++;
|
k6++;
|
||||||
} else {
|
} else {
|
||||||
flag1 = true;
|
flag2 = true;
|
||||||
}
|
}
|
||||||
} while (!flag1 && i7++ < 12);
|
} while (!flag2 && j7++ < 12);
|
||||||
setBlock(world,j1 + j3 + 4, k1 - k5 - j6, l1 - 6, pickBlock(random));
|
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 6, pickBlock(random));
|
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + j3 + 4, ((k1 - k5) + 2) - j6, l1 - 6, pickBlock(random));
|
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 1, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + j3 + 4, k1 - k5 - j6, l1 - 7, pickBlock(random));
|
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 2, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 7, pickBlock(random));
|
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 2, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + j3 + 5, k1 - k5 - j6, l1 - 7, pickBlock(random));
|
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 2, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + j3 + 5, ((k1 - k5) + 1) - j6, l1 - 7, pickBlock(random));
|
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 3, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + j3 + 5, ((k1 - k5) + 2) - j6, l1 - 7, pickBlock(random));
|
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 3, Block.cobblestone.blockID);
|
||||||
setBlock(world,j1 + j3 + 6, k1 - k5 - j6, l1 - 7, pickBlock(random));
|
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 4, Block.cobblestone.blockID);
|
||||||
l7 = random.nextInt(100);
|
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 4, Block.cobblestoneMossy.blockID);
|
||||||
if (l7 <= 30) {
|
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 5, Block.cobblestoneMossy.blockID);
|
||||||
setBlock(world,j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Blocks.dirt);
|
i8 = random.nextInt(100);
|
||||||
setBlock(world,j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Blocks.dirt);
|
if (i8 <= 30) {
|
||||||
|
world.setBlock(j1 - 3, k1 - l5 - k6 - i5 - 1, l1 + k3 + 3, Block.dirt.blockID);
|
||||||
|
world.setBlock(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3, Block.chest.blockID);
|
||||||
|
ChestFiller.fillWithRares(world.getBlockTileEntity(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i2 != 3) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
int l2 = random.nextInt(8) + 5;
|
|
||||||
int k3 = random.nextInt(8) + 5;
|
|
||||||
int j4 = random.nextInt(8) + 5;
|
|
||||||
int i5 = random.nextInt(4) + 3;
|
|
||||||
int l5;
|
|
||||||
int l8 = random.nextInt(100);
|
|
||||||
if (l8 <= 20) {
|
|
||||||
l5 = 0;
|
|
||||||
} else {
|
|
||||||
l5 = random.nextInt(4) + 5;
|
|
||||||
}
|
|
||||||
setBlock(world,j1, k1 - l5, l1, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 1, k1 - l5, l1, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 1, (k1 - l5) + 1, l1, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 1, (k1 - l5) + 2, l1, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 1, (k1 - l5) + 3, l1, pickBlock(random));
|
|
||||||
setBlock(world,j1, (k1 - l5) + 1, l1, pickBlock(random));
|
|
||||||
setBlock(world,j1, (k1 - l5) + 2, l1, pickBlock(random));
|
|
||||||
setBlock(world,j1, (k1 - l5) + 3, l1, pickBlock(random));
|
|
||||||
setBlock(world,j1, (k1 - l5) + 4, l1, pickBlock(random));
|
|
||||||
setBlock(world,j1, (k1 - l5) + 5, l1, pickBlock(random));
|
|
||||||
setBlock(world,j1, k1 - l5, l1 + 1, pickBlock(random));
|
|
||||||
setBlock(world,j1, (k1 - l5) + 2, l1 + 1, pickBlock(random));
|
|
||||||
setBlock(world,j1, k1 - l5, l1 + 2, pickBlock(random));
|
|
||||||
setBlock(world,j1, (k1 - l5) + 1, l1 + 2, pickBlock(random));
|
|
||||||
setBlock(world,j1, k1 - l5 - i5, l1 + 1, Blocks.dirt);
|
|
||||||
setBlock(world,j1, k1 - l5 - i5 - 1, l1 + 1, Blocks.dirt);
|
|
||||||
int j7 = 1;
|
|
||||||
int k6 = 0;
|
|
||||||
boolean flag2 = false;
|
|
||||||
do {
|
|
||||||
if (world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4)
|
|
||||||
|| world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Blocks.water || world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Blocks.water
|
|
||||||
|| world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Blocks.water) {
|
|
||||||
k6++;
|
|
||||||
} else {
|
|
||||||
flag2 = true;
|
|
||||||
}
|
|
||||||
} while (!flag2 && j7++ < 12);
|
|
||||||
setBlock(world,j1 + k3 + l2, k1 - l5 - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2 + 1, k1 - l5 - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2 + 2, k1 - l5 - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2 + 3, k1 - l5 - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 1, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 1, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 1, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2, ((k1 - l5) + 3) - k6, l1 + j4 + 1, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 2, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 2, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 3, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 3, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 6, pickBlock(random));
|
|
||||||
int i8 = random.nextInt(100);
|
|
||||||
if (i8 <= 30) {
|
|
||||||
setBlock(world,j1 + k3 + l2, k1 - l5 - k6 - i5, l1 + j4 + 1, Blocks.dirt);
|
|
||||||
setBlock(world,j1 + k3 + l2, k1 - l5 - k6 - i5 - 1, l1 + j4 + 1, Blocks.dirt);
|
|
||||||
}
|
|
||||||
j7 = 1;
|
|
||||||
k6 = 0;
|
|
||||||
flag2 = false;
|
|
||||||
do {
|
|
||||||
if (world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) || world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) || world.isAirBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6)
|
|
||||||
|| world.getBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) == Blocks.water || world.getBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) == Blocks.water
|
|
||||||
|| world.getBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Blocks.water) {
|
|
||||||
k6++;
|
|
||||||
} else {
|
|
||||||
flag2 = true;
|
|
||||||
}
|
|
||||||
} while (!flag2 && j7++ < 12);
|
|
||||||
setBlock(world,j1 - k3, k1 - l5 - k6, l1 - l2 - 1, pickBlock(random));
|
|
||||||
setBlock(world,j1 - k3, (k1 - l5 - k6) + 1, l1 - l2 - 1, pickBlock(random));
|
|
||||||
setBlock(world,j1 - k3, (k1 - l5 - k6) + 2, l1 - l2 - 1, pickBlock(random));
|
|
||||||
setBlock(world,j1 - k3, k1 - l5 - k6, l1 - l2 - 2, pickBlock(random));
|
|
||||||
setBlock(world,j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 2, pickBlock(random));
|
|
||||||
setBlock(world,j1 - k3, k1 - l5 - k6, l1 - l2 - 3, pickBlock(random));
|
|
||||||
setBlock(world,j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 3, pickBlock(random));
|
|
||||||
setBlock(world,j1 - k3, k1 - l5 - k6, l1 - l2 - 4, pickBlock(random));
|
|
||||||
setBlock(world,j1 - k3 - 1, k1 - l5 - k6, l1 - l2 - 6, pickBlock(random));
|
|
||||||
setBlock(world,j1 - k3 - 2, k1 - l5 - k6, l1 - l2 - 6, pickBlock(random));
|
|
||||||
setBlock(world,j1 - k3 - 2, ((k1 - l5) + 1) - k6, l1 - l2 - 6, pickBlock(random));
|
|
||||||
setBlock(world,j1 - k3 - 3, k1 - l5 - k6, l1 - l2 - 6, pickBlock(random));
|
|
||||||
i8 = random.nextInt(100);
|
|
||||||
if (i8 <= 60) {
|
|
||||||
setBlock(world,j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Blocks.dirt);
|
|
||||||
setBlock(world,j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, Blocks.dirt);
|
|
||||||
}
|
|
||||||
j7 = 1;
|
|
||||||
k6 = 0;
|
|
||||||
flag2 = false;
|
|
||||||
do {
|
|
||||||
if (world.isAirBlock(j1 + l2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4)
|
|
||||||
|| world.getBlock(j1 + l2, k1 - l5 - j7, l1 + j4) == Blocks.water || world.getBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) == Blocks.water
|
|
||||||
|| world.getBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Blocks.water) {
|
|
||||||
k6++;
|
|
||||||
} else {
|
|
||||||
flag2 = true;
|
|
||||||
}
|
|
||||||
} while (!flag2 && j7++ < 12);
|
|
||||||
setBlock(world,j1 + l2, k1 - l5 - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + l2 + 1, k1 - l5 - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + l2 + 1, ((k1 - l5) + 2) - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + l2 + 1, ((k1 - l5) + 3) - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + l2 + 2, k1 - l5 - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + l2 + 2, ((k1 - l5) + 1) - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + l2 + 2, ((k1 - l5) + 2) - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + l2 + 3, ((k1 - l5) + 2) - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + l2 + 4, k1 - l5 - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + l2 + 4, ((k1 - l5) + 1) - k6, l1 + j4, pickBlock(random));
|
|
||||||
setBlock(world,j1 + l2 + 5, k1 - l5 - k6, l1 + j4, pickBlock(random));
|
|
||||||
i8 = random.nextInt(100);
|
|
||||||
if (i8 <= 30) {
|
|
||||||
setBlock(world,j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Blocks.dirt);
|
|
||||||
setBlock(world,j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Blocks.dirt);
|
|
||||||
}
|
|
||||||
j7 = 1;
|
|
||||||
k6 = 0;
|
|
||||||
flag2 = false;
|
|
||||||
do {
|
|
||||||
if (world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4)
|
|
||||||
|| world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) == Blocks.water || world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) == Blocks.water
|
|
||||||
|| world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Blocks.water) {
|
|
||||||
k6++;
|
|
||||||
} else {
|
|
||||||
flag2 = true;
|
|
||||||
}
|
|
||||||
} while (!flag2 && j7++ < 12);
|
|
||||||
setBlock(world,j1 - 3, k1 - l5 - k6, l1 + k3, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 1, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 3, k1 - l5 - k6, l1 + k3 + 2, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 2, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 2, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 3, k1 - l5 - k6, l1 + k3 + 3, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 3, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 3, k1 - l5 - k6, l1 + k3 + 4, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 4, pickBlock(random));
|
|
||||||
setBlock(world,j1 - 3, k1 - l5 - k6, l1 + k3 + 5, pickBlock(random));
|
|
||||||
i8 = random.nextInt(100);
|
|
||||||
if (i8 <= 30) {
|
|
||||||
setBlock(world,j1 - 3, k1 - l5 - k6 - i5 - 1, l1 + k3 + 3, Blocks.dirt);
|
|
||||||
setBlock(world,j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3, Blocks.chest);
|
|
||||||
ChestFiller.fillWithRares(world.getTileEntity(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3));
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Block pickBlock(Random random) {
|
|
||||||
return random.nextBoolean() ? Blocks.cobblestone : Blocks.mossy_cobblestone;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setBlock(World w, int x, int y, int z){
|
|
||||||
func_150515_a(w, x, y, z, Blocks.air);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setBlock(World w, int x, int y, int z, Block bl){
|
|
||||||
func_150515_a(w, x, y, z, bl);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setBlockAndMetadata(World w, int x, int y, int z, Block bl, int meta){
|
|
||||||
setBlockAndNotifyAdequately(w, x, y, z, bl, meta);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,27 @@
|
||||||
package mysticstones.blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticstones.MysticStones;
|
|
||||||
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.IconRegister;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.Icon;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockPlanks extends BlockMulti {
|
public class BlockPlanks extends BlockMulti {
|
||||||
public BlockPlanks() {
|
public BlockPlanks(int ID) {
|
||||||
super(Material.wood);
|
super(ID, Material.wood);
|
||||||
setHardness(2.5F);
|
setHardness(2.5F);
|
||||||
setResistance(10F);
|
setResistance(10F);
|
||||||
setBlockName("BlockMysticPlanks");
|
setUnlocalizedName("BlockMysticPlanks");
|
||||||
setStepSound(Block.soundTypeWood);
|
setStepSound(Block.soundWoodFootstep);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
textures = new IIcon[MysticStones.PLANK_TYPE.size()];
|
textures = new Icon[ItemPlanks.PLANK_TYPE.length];
|
||||||
for (int i = 0; i < textures.length; i++) {
|
for (int i = 0; i < textures.length; i++) {
|
||||||
textures[i] = iconRegister.registerIcon("mysticstones:" + MysticStones.PLANK_TYPE.get(i));
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemPlanks.PLANK_TYPE[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,33 @@
|
||||||
package mysticstones.blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
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.IconRegister;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockReinforced extends BlockMulti {
|
public class BlockReinforced extends BlockMulti {
|
||||||
public BlockReinforced() {
|
public BlockReinforced(int ID) {
|
||||||
super(Material.iron);
|
super(ID, Material.iron);
|
||||||
setHardness(4F);
|
setHardness(4F);
|
||||||
setResistance(2000F);
|
setResistance(2000F);
|
||||||
setBlockName("BlockMysticReinforcedBrick");
|
setUnlocalizedName("BlockMysticReinforcedBrick");
|
||||||
setStepSound(Block.soundTypeMetal);
|
setStepSound(Block.soundMetalFootstep);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
textures = new IIcon[ItemReinforced.BRICK_TYPE.size()];
|
textures = new Icon[ItemReinforced.BRICK_TYPE.length];
|
||||||
for (int i = 0; i < textures.length; i++) {
|
for (int i = 0; i < textures.length; i++) {
|
||||||
textures[i] = iconRegister.registerIcon("mysticstones:" + ItemReinforced.BRICK_TYPE.get(i));
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemReinforced.BRICK_TYPE[i] + " Bricks");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,27 @@
|
||||||
package mysticstones.blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticstones.MysticStones;
|
|
||||||
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.IconRegister;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.Icon;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockStoneBricks extends BlockMulti {
|
public class BlockStoneBricks extends BlockMulti {
|
||||||
public BlockStoneBricks() {
|
public BlockStoneBricks(int ID) {
|
||||||
super(Material.rock);
|
super(ID, Material.rock);
|
||||||
setHardness(2F);
|
setHardness(2F);
|
||||||
setResistance(5F);
|
setResistance(5F);
|
||||||
setBlockName("BlockMysticStoneBricks");
|
setUnlocalizedName("BlockMysticStoneBricks");
|
||||||
setStepSound(Block.soundTypeStone);
|
setStepSound(Block.soundStoneFootstep);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
textures = new IIcon[MysticStones.STONEBRICK_TYPES.size()];
|
textures = new Icon[ItemStoneBricks.STONEBRICK_TYPES.length];
|
||||||
for (int i = 0; i < textures.length; i++) {
|
for (int i = 0; i < textures.length; i++) {
|
||||||
textures[i] = iconRegister.registerIcon("mysticstones:" + MysticStones.STONEBRICK_TYPES.get(i));
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemStoneBricks.STONEBRICK_TYPES[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,22 @@
|
||||||
package mysticstones.blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticstones.MysticStones;
|
|
||||||
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.IconRegister;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockStones extends BlockMulti {
|
public class BlockStones extends BlockMulti {
|
||||||
public BlockStones() {
|
public BlockStones(int ID) {
|
||||||
super(Material.rock);
|
super(ID, Material.rock);
|
||||||
setHardness(1F);
|
setHardness(1F);
|
||||||
setResistance(5F);
|
setResistance(5F);
|
||||||
setBlockName("BlockMysticStones");
|
setUnlocalizedName("BlockMysticStones");
|
||||||
setStepSound(Block.soundTypeStone);
|
setStepSound(Block.soundStoneFootstep);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -49,10 +48,15 @@ public class BlockStones extends BlockMulti {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
textures = new IIcon[MysticStones.STONE_TYPES.size()];
|
textures = new Icon[ItemStones.STONE_TYPES.length];
|
||||||
for (int i = 0; i < textures.length; i++) {
|
for (int i = 0; i < textures.length; i++) {
|
||||||
textures[i] = iconRegister.registerIcon("mysticstones:" + MysticStones.STONE_TYPES.get(i));
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemStones.STONE_TYPES[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean canSilkHarvest() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
common/MysticStones/Blocks/ItemPlanks.java
Normal file
11
common/MysticStones/Blocks/ItemPlanks.java
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
package mysticstones.blocks;
|
||||||
|
|
||||||
|
import mysticstones.MysticStones;
|
||||||
|
|
||||||
|
public class ItemPlanks extends ItemBlockMulti {
|
||||||
|
public static final String[] PLANK_TYPE = new String[] { "Purple Planks", "Green Planks", "Black Planks", "Orange Planks", "Red Planks", "Blue Planks", "Yellow Planks" };
|
||||||
|
|
||||||
|
public ItemPlanks(int par1) {
|
||||||
|
super(par1, MysticStones.Planks, PLANK_TYPE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,27 +1,24 @@
|
||||||
package mysticstones.blocks;
|
package mysticstones.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ItemReinforced extends ItemBlockMulti {
|
import mysticstones.MysticStones;
|
||||||
public static final ArrayList<String> BRICK_TYPE = new ArrayList<String>(Arrays.asList("Mithril Bricks", "Verdite Bricks", "Iridium Bricks", "Adamantine Bricks", "Tourmaline Bricks", "Topaz Bricks", "Amethyst Bricks",
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
"Agate Bricks"));
|
import net.minecraft.item.ItemStack;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public ItemReinforced(Block block) {
|
public class ItemReinforced extends ItemBlockMulti {
|
||||||
super(block, BRICK_TYPE);
|
public static final String[] BRICK_TYPE = new String[] { "Mithril Bricks", "Verdite Bricks", "Iridium Bricks", "Adamantine Bricks", "Tourmaline Bricks", "Topaz Bricks", "Amethyst Bricks",
|
||||||
|
"Agate Bricks" };
|
||||||
|
|
||||||
|
public ItemReinforced(int par1) {
|
||||||
|
super(par1, MysticStones.ReinforcedBricks, BRICK_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||||
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
|
||||||
if (par4) {
|
if (par4) {
|
||||||
par3List.add("Works As A Beacon Block Too!");
|
par3List.add("Works As A Beacon Block Too!");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
common/MysticStones/Blocks/ItemStoneBricks.java
Normal file
12
common/MysticStones/Blocks/ItemStoneBricks.java
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
package mysticstones.blocks;
|
||||||
|
|
||||||
|
import mysticstones.MysticStones;
|
||||||
|
|
||||||
|
public class ItemStoneBricks extends ItemBlockMulti {
|
||||||
|
public static final String[] STONEBRICK_TYPES = new String[] { "Anorthosite Bricks", "Limestone Bricks", "Marble Bricks", "Migmatite Bricks", "Orthogneiss Bricks", "Slate Bricks",
|
||||||
|
"Travertine Bricks" };
|
||||||
|
|
||||||
|
public ItemStoneBricks(int par1) {
|
||||||
|
super(par1, MysticStones.StoneBricks, STONEBRICK_TYPES);
|
||||||
|
}
|
||||||
|
}
|
||||||
12
common/MysticStones/Blocks/ItemStones.java
Normal file
12
common/MysticStones/Blocks/ItemStones.java
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
package mysticstones.blocks;
|
||||||
|
|
||||||
|
import mysticstones.MysticStones;
|
||||||
|
|
||||||
|
public class ItemStones extends ItemBlockMulti {
|
||||||
|
public static final String[] STONE_TYPES = new String[] { "Smooth Anorthosite", "Anorthosite", "Smooth Limestone", "Limestone", "Smooth Marble", "Marble", "Smooth Migmatite", "Migmatite",
|
||||||
|
"Smooth Orthogneiss", "Orthogneiss", "Smooth Slate", "Slate", "Smooth Travertine", "Travertine" };
|
||||||
|
|
||||||
|
public ItemStones(int par1) {
|
||||||
|
super(par1, MysticStones.Stones, STONE_TYPES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,62 +1,51 @@
|
||||||
package mysticstones;
|
package mysticstones;
|
||||||
|
|
||||||
|
import mysticstones.blocks.BlockPlanks;
|
||||||
|
import mysticstones.blocks.BlockReinforced;
|
||||||
|
import mysticstones.blocks.BlockStoneBricks;
|
||||||
|
import mysticstones.blocks.BlockStones;
|
||||||
|
import mysticstones.blocks.ItemPlanks;
|
||||||
|
import mysticstones.blocks.ItemReinforced;
|
||||||
|
import mysticstones.blocks.ItemStoneBricks;
|
||||||
|
import mysticstones.blocks.ItemStones;
|
||||||
|
import mysticstones.util.Config;
|
||||||
|
import mysticstones.util.Localizations;
|
||||||
|
import mysticstones.util.RecipeHandler;
|
||||||
|
import mysticstones.util.TabMysticStones;
|
||||||
|
import mysticstones.worldgen.WorldGeneratorStones;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
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.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.network.NetworkMod;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticstones.blocks.*;
|
|
||||||
import mysticstones.util.Config;
|
|
||||||
import mysticstones.util.RecipeHandler;
|
|
||||||
import mysticstones.worldgen.WorldGeneratorStones;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
@Mod(modid = "Mystic Stones", name = "Mystic Stones", version = "0.1")
|
||||||
import java.util.Arrays;
|
@NetworkMod(clientSideRequired = true)
|
||||||
|
public class MysticStones {
|
||||||
@Mod(modid = "mysticstones", name = "Mystic Stones", version = "0.2")
|
@Instance("Mystic Stones")
|
||||||
public final class MysticStones {
|
|
||||||
@Instance("mysticstones")
|
|
||||||
public static MysticStones instance;
|
public static MysticStones instance;
|
||||||
public static boolean ENABLE = true;
|
public static Block Planks, Stones, StoneBricks, ReinforcedBricks;
|
||||||
public static Block planks, stones, stoneBricks, reinforcedBricks;
|
public static final CreativeTabs MysticStonesTab = new TabMysticStones("MysticStonesTab");
|
||||||
public static CreativeTabs MysticStonesTab;
|
|
||||||
public static final ArrayList<String> PLANK_TYPE = new ArrayList<String>(Arrays.asList("Purple Planks", "Green Planks", "Black Planks", "Orange Planks", "Red Planks", "Blue Planks", "Yellow Planks"));
|
|
||||||
public static final ArrayList<String> STONEBRICK_TYPES = new ArrayList<String>(Arrays.asList("Anorthosite Bricks", "Limestone Bricks", "Marble Bricks", "Migmatite Bricks", "Orthogneiss Bricks", "Slate Bricks",
|
|
||||||
"Travertine Bricks"));
|
|
||||||
public static final ArrayList<String> STONE_TYPES = new ArrayList<String>(Arrays.asList("Smooth Anorthosite", "Anorthosite", "Smooth Limestone", "Limestone", "Smooth Marble", "Marble", "Smooth Migmatite", "Migmatite",
|
|
||||||
"Smooth Orthogneiss", "Orthogneiss", "Smooth Slate", "Slate", "Smooth Travertine", "Travertine"));
|
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
@EventHandler
|
|
||||||
public void preInit(FMLPreInitializationEvent event) {
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
Config.initialize(event.getSuggestedConfigurationFile());
|
Config.initialize(event.getSuggestedConfigurationFile());
|
||||||
if(ENABLE){
|
Planks = new BlockPlanks(Config.PlanksID);
|
||||||
MysticStonesTab = new CreativeTabs("MysticStonesTab") {
|
Stones = new BlockStones(Config.StonesID);
|
||||||
@Override
|
StoneBricks = new BlockStoneBricks(Config.StoneBricksID);
|
||||||
@SideOnly(Side.CLIENT)
|
ReinforcedBricks = new BlockReinforced(Config.ReinforcedBricksID);
|
||||||
public int func_151243_f()
|
GameRegistry.registerBlock(Planks, ItemPlanks.class, "Planks");
|
||||||
{
|
GameRegistry.registerBlock(Stones, ItemStones.class, "Stones");
|
||||||
return 4;
|
GameRegistry.registerBlock(StoneBricks, ItemStoneBricks.class, "StoneBricks");
|
||||||
}
|
GameRegistry.registerBlock(ReinforcedBricks, ItemReinforced.class, "Reinforcedbricks");
|
||||||
@Override
|
Localizations.Initialize();
|
||||||
public Item getTabIconItem() {
|
RecipeHandler.CraftPlanks();
|
||||||
return Item.getItemFromBlock(MysticStones.reinforcedBricks);
|
RecipeHandler.CraftStoneBricks();
|
||||||
}
|
RecipeHandler.CraftReinforced();
|
||||||
};
|
RecipeHandler.CraftElse();
|
||||||
planks = GameRegistry.registerBlock(new BlockPlanks(), ItemBlockMulti.class, "Planks", PLANK_TYPE);
|
GameRegistry.registerWorldGenerator(new WorldGeneratorStones());
|
||||||
stones = GameRegistry.registerBlock(new BlockStones(), ItemBlockMulti.class, "Stones", STONE_TYPES);
|
|
||||||
stoneBricks = GameRegistry.registerBlock(new BlockStoneBricks(), ItemBlockMulti.class, "StoneBricks", STONEBRICK_TYPES);
|
|
||||||
reinforcedBricks = GameRegistry.registerBlock(new BlockReinforced(), ItemReinforced.class, "Reinforcedbricks");
|
|
||||||
RecipeHandler.craftPlanks();
|
|
||||||
RecipeHandler.craftStoneBricks();
|
|
||||||
RecipeHandler.craftReinforced();
|
|
||||||
RecipeHandler.craftElse();
|
|
||||||
GameRegistry.registerWorldGenerator(new WorldGeneratorStones(), 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,27 @@
|
||||||
package mysticstones.util;
|
package mysticstones.util;
|
||||||
|
|
||||||
import mysticstones.MysticStones;
|
import java.util.List;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
|
||||||
|
import net.minecraftforge.common.Configuration;
|
||||||
|
|
||||||
public class Config {
|
public class Config {
|
||||||
public static final String[] keys = { "anorthosite", "limestone", "marble", "migmatite", "orthogneiss", "slate", "travertine" };
|
public static int PlanksID;
|
||||||
public static int[] rare = new int[keys.length];
|
public static int StonesID;
|
||||||
public static List<Integer> allowed = new ArrayList<Integer>();
|
public static int StoneBricksID;
|
||||||
|
public static int ReinforcedBricksID;
|
||||||
|
public static int Rare;
|
||||||
|
public static List<Integer> allowed = new ArrayList();
|
||||||
|
|
||||||
public static void initialize(File file) {
|
public static void initialize(File file) {
|
||||||
Configuration config = new Configuration(file);
|
Configuration config = new Configuration(file);
|
||||||
MysticStones.ENABLE = config.get("General", "Enable", true).getBoolean(true);
|
config.load();
|
||||||
for (int i = 0; i < rare.length; i++) {
|
PlanksID = config.getBlock("Plank IDs", 509).getInt();
|
||||||
rare[i] = config.get("Generation", "Rarity of " + keys[i], 3).getInt();
|
StonesID = config.getBlock("Stone IDs", 510).getInt();
|
||||||
}
|
StoneBricksID = config.getBlock("Stone Brick IDs", 511).getInt();
|
||||||
|
ReinforcedBricksID = config.getBlock("Reinforced Brick IDs", 512).getInt();
|
||||||
|
Rare = config.get("Generation", "Rarity of Stones", 3).getInt();
|
||||||
for (String id : config.get("Generation", "Allowed Dimension ID", "0,").getString().split(",")) {
|
for (String id : config.get("Generation", "Allowed Dimension ID", "0,").getString().split(",")) {
|
||||||
try {
|
try {
|
||||||
allowed.add(Integer.parseInt(id.trim()));
|
allowed.add(Integer.parseInt(id.trim()));
|
||||||
|
|
|
||||||
95
common/MysticStones/Util/Localizations.java
Normal file
95
common/MysticStones/Util/Localizations.java
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
package mysticstones.util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipException;
|
||||||
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
|
import mysticstones.MysticStones;
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* All credits go to copygirl (or copy....boy) for this one
|
||||||
|
* Couldn't have done any of this without your
|
||||||
|
* repository, many thanks friend c:
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class Localizations {
|
||||||
|
private Localizations() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Initialize() {
|
||||||
|
File source = Loader.instance().getReversedModObjectList().get(MysticStones.instance).getSource();
|
||||||
|
Pattern pattern = Pattern.compile(".*(assets/" + "mysticmods/lang/(.+)\\.(.+))");
|
||||||
|
for (String file : getResources(source, pattern)) {
|
||||||
|
Matcher matcher = pattern.matcher(file);
|
||||||
|
matcher.find();
|
||||||
|
String resource = "/" + matcher.group(1);
|
||||||
|
String lang = matcher.group(2);
|
||||||
|
boolean isXML = matcher.group(3).equalsIgnoreCase("XML");
|
||||||
|
LanguageRegistry.instance().loadLocalization(resource, lang, isXML);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Collection<String> getResources(File file, Pattern pattern) {
|
||||||
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
|
if (file.isDirectory())
|
||||||
|
retval.addAll(getResourcesFromDirectory(file, pattern));
|
||||||
|
else
|
||||||
|
retval.addAll(getResourcesFromJarFile(file, pattern));
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Collection<String> getResourcesFromDirectory(File directory, Pattern pattern) {
|
||||||
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
|
File[] FileList = directory.listFiles();
|
||||||
|
for (File file : FileList) {
|
||||||
|
if (file.isDirectory()) {
|
||||||
|
retval.addAll(getResourcesFromDirectory(file, pattern));
|
||||||
|
} else
|
||||||
|
try {
|
||||||
|
String fileName = file.getCanonicalPath().replace('\\', '/');
|
||||||
|
boolean accept = pattern.matcher(fileName).matches();
|
||||||
|
if (accept)
|
||||||
|
retval.add(fileName);
|
||||||
|
} catch (final IOException e) {
|
||||||
|
throw new Error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Collection<String> getResourcesFromJarFile(File file, Pattern pattern) {
|
||||||
|
ArrayList<String> retval = new ArrayList<String>();
|
||||||
|
ZipFile Zip;
|
||||||
|
try {
|
||||||
|
Zip = new ZipFile(file);
|
||||||
|
} catch (ZipException Ex) {
|
||||||
|
throw new Error(Ex);
|
||||||
|
} catch (IOException Ex) {
|
||||||
|
throw new Error(Ex);
|
||||||
|
}
|
||||||
|
Enumeration<? extends ZipEntry> entries = Zip.entries();
|
||||||
|
while (entries.hasMoreElements()) {
|
||||||
|
ZipEntry ZipE = entries.nextElement();
|
||||||
|
String FileName = ZipE.getName();
|
||||||
|
boolean accept = pattern.matcher(FileName).matches();
|
||||||
|
if (accept)
|
||||||
|
retval.add(FileName);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Zip.close();
|
||||||
|
} catch (IOException Ex) {
|
||||||
|
throw new Error(Ex);
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,45 +1,48 @@
|
||||||
package mysticstones.util;
|
package mysticstones.util;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import mysticstones.MysticStones;
|
import mysticstones.MysticStones;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class RecipeHandler {
|
public class RecipeHandler {
|
||||||
public static final String[] MATERIALS = { "ingotMithril", "ingotVerdite", "ingotIridium", "ingotAdamantine", "gemTourmaline", "gemTopaz", "gemAmethyst", "gemAgate" };
|
public static final String[] MATERIALS = { "ingotMithril", "ingotVerdite", "ingotIridium", "ingotAdamantine", "gemTourmaline", "gemTopaz", "gemAmethyst", "gemAgate" };
|
||||||
public static final String[] STONES = { "anorthositeSmooth", "Anorthosite", "limestoneSmooth", "limestone", "marbleSmooth", "marble", "migmatiteSmooth", "migmatite", "orthogneissSmooth",
|
public static final String[] STONES = { "anorthositeSmooth", "Anorthosite", "limestoneSmooth", "limestone", "marbleSmooth", "marble", "migmatiteSmooth", "migmatite", "orthogneissSmooth",
|
||||||
"orthogneiss", "slateSmooth", "slate", "travertineSmooth", "travertine" };
|
"orthogneiss", "slateSmooth", "slate", "travertineSmooth", "travertine" };
|
||||||
|
|
||||||
public static void craftElse() {
|
public static void CraftElse() {
|
||||||
//smelting
|
//smelting
|
||||||
for (int i = 1; i < 14; i += 2) {
|
for (int i = 1; i < 14; i += 2) {
|
||||||
FurnaceRecipes.smelting().func_151394_a(new ItemStack(MysticStones.stones, 1, i), new ItemStack(MysticStones.stones, 1, i - 1), 0.1F);
|
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, i, new ItemStack(MysticStones.Stones, 1, i - 1), 0.1F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void craftPlanks() {
|
public static void CraftPlanks() {
|
||||||
for (int i = 0; i < 7; i++) {
|
for (int i = 0; i < 7; i++) {
|
||||||
ItemStack stack = new ItemStack(MysticStones.planks, 1, i);
|
ItemStack stack = new ItemStack(MysticStones.Planks, 1, i);
|
||||||
OreDictionary.registerOre("plankWood", stack);
|
OreDictionary.registerOre("plankWood", stack);
|
||||||
OreDictionary.registerOre(STONES[2 * i], new ItemStack(MysticStones.stones, 1, 2 * i));
|
OreDictionary.registerOre(STONES[2 * i], new ItemStack(MysticStones.Stones, 1, 2 * i));
|
||||||
OreDictionary.registerOre(STONES[2 * i + 1], new ItemStack(MysticStones.stones, 1, 2 * i + 1));
|
OreDictionary.registerOre(STONES[2 * i + 1], new ItemStack(MysticStones.Stones, 1, 2 * i + 1));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(stack, "plankWood", STONES[2 * i]));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(stack, "plankWood", STONES[2 * i]));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(stack, "plankWood", STONES[2 * i + 1]));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(stack, "plankWood", STONES[2 * i + 1]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void craftReinforced() {
|
public static void CraftReinforced() {
|
||||||
for (int i = 0; i < MATERIALS.length; i++) {
|
if (Loader.isModLoaded("MysticOres")) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(MysticStones.reinforcedBricks, 1, i), true, "#$#", "$$$", "#$#", '$', MATERIALS[i], '#', "stone"));
|
for (int i = 0; i < MATERIALS.length; i++) {
|
||||||
}
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, i), true, "#$#", "$$$", "#$#", '$', MATERIALS[i], '#', "stone"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void craftStoneBricks() {
|
public static void CraftStoneBricks() {
|
||||||
for (int i = 0; i < 7; i++) {
|
for (int i = 0; i < 7; i++) {
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(MysticStones.stoneBricks, 4, i), "##", "##", '#', STONES[2 * i]));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(MysticStones.StoneBricks, 4, i), "##", "##", '#', STONES[2 * i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
common/MysticStones/Util/TabMysticStones.java
Normal file
16
common/MysticStones/Util/TabMysticStones.java
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
package mysticstones.util;
|
||||||
|
|
||||||
|
import mysticstones.MysticStones;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class TabMysticStones extends CreativeTabs {
|
||||||
|
public TabMysticStones(String par2Str) {
|
||||||
|
super(par2Str);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getIconItemStack() {
|
||||||
|
return new ItemStack(MysticStones.ReinforcedBricks, 1, 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,26 +1,25 @@
|
||||||
package mysticworld.biome;
|
package mysticworld.biome;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.entity.monster.EntityCreeper;
|
||||||
|
import net.minecraft.entity.monster.EntityGhast;
|
||||||
|
import net.minecraft.entity.monster.EntityGiantZombie;
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import net.minecraft.world.biome.SpawnListEntry;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||||
|
|
||||||
public class BiomeGenBasic extends BiomeGenBase {
|
public class BiomeGenBasic extends BiomeGenBase {
|
||||||
public BiomeGenBasic(int id, Block blockTop, Block blockFiller) {
|
|
||||||
super(id);
|
|
||||||
this.topBlock = blockTop;
|
|
||||||
this.fillerBlock = blockFiller;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BiomeGenBasic(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk) {
|
public BiomeGenBasic(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) {
|
||||||
super(id);
|
super(id);
|
||||||
|
this.topBlock = (byte) blockTop;
|
||||||
|
this.fillerBlock = (byte) blockFiller;
|
||||||
this.theBiomeDecorator.treesPerChunk = treesChunk;
|
this.theBiomeDecorator.treesPerChunk = treesChunk;
|
||||||
this.theBiomeDecorator.grassPerChunk = grassChunk;
|
this.theBiomeDecorator.grassPerChunk = grassChunk;
|
||||||
this.theBiomeDecorator.flowersPerChunk = flowerChunk;
|
this.theBiomeDecorator.flowersPerChunk = flowerChunk;
|
||||||
this.theBiomeDecorator.reedsPerChunk = reedsChunk;
|
this.theBiomeDecorator.reedsPerChunk = reedsChunk;;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BiomeGenBasic(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, Block blockTop, Block blockFiller) {
|
|
||||||
this(id, treesChunk, grassChunk, flowerChunk, reedsChunk);
|
|
||||||
this.topBlock = blockTop;
|
|
||||||
this.fillerBlock = blockFiller;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,29 @@
|
||||||
package mysticworld.biome;
|
package mysticworld.biome;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import java.util.Random;
|
||||||
|
|
||||||
public class BiomeGenGlacier extends BiomeGenTundra {
|
import net.minecraft.entity.monster.EntityCreeper;
|
||||||
public BiomeGenGlacier(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, Block blockTop, Block blockFiller) {
|
import net.minecraft.entity.monster.EntityGhast;
|
||||||
super(id, treesChunk, grassChunk, flowerChunk, reedsChunk, blockTop, blockFiller);
|
import net.minecraft.entity.monster.EntityGiantZombie;
|
||||||
this.waterColorMultiplier = 15397370;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import net.minecraft.world.biome.SpawnListEntry;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||||
|
|
||||||
|
public class BiomeGenGlacier extends BiomeGenBase {
|
||||||
|
|
||||||
|
public BiomeGenGlacier(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) {
|
||||||
|
super(id);
|
||||||
|
this.topBlock = (byte) blockTop;
|
||||||
|
this.fillerBlock = (byte) blockFiller;
|
||||||
|
this.theBiomeDecorator.treesPerChunk = treesChunk;
|
||||||
|
this.theBiomeDecorator.grassPerChunk = grassChunk;
|
||||||
|
this.theBiomeDecorator.flowersPerChunk = flowerChunk;
|
||||||
|
this.theBiomeDecorator.reedsPerChunk = reedsChunk;;
|
||||||
|
this.spawnableCreatureList.clear();
|
||||||
|
this.spawnableMonsterList.clear();
|
||||||
|
this.spawnableWaterCreatureList.clear();
|
||||||
|
this.spawnableCreatureList.add(new SpawnListEntry(net.minecraft.entity.passive.EntityWolf.class, 5, 4, 4));
|
||||||
|
this.waterColorMultiplier = 15397370;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,58 @@
|
||||||
package mysticworld.biome;
|
package mysticworld.biome;
|
||||||
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenMegaJungle;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenTrees;
|
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.passive.EntityChicken;
|
||||||
|
import net.minecraft.entity.passive.EntityOcelot;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import net.minecraft.world.biome.SpawnListEntry;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenHugeTrees;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenShrub;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenTallGrass;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenTrees;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenVines;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||||
|
|
||||||
public class BiomeGenJungle extends net.minecraft.world.biome.BiomeGenJungle {
|
public class BiomeGenJungle extends BiomeGenBase
|
||||||
public BiomeGenJungle(int par1) {
|
{
|
||||||
super(par1, false);
|
public BiomeGenJungle(int par1)
|
||||||
}
|
{
|
||||||
|
super(par1);
|
||||||
|
this.theBiomeDecorator.treesPerChunk = 50;
|
||||||
|
this.theBiomeDecorator.grassPerChunk = 25;
|
||||||
|
this.theBiomeDecorator.flowersPerChunk = 4;
|
||||||
|
this.spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1));
|
||||||
|
this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public WorldGenAbstractTree func_150567_a(Random par1Random) {
|
* Gets a WorldGen appropriate for this biome.
|
||||||
return par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : (par1Random.nextInt(2) == 0 ? new WorldGenMegaJungle(false, 10, 20, 3, 3) : new WorldGenTrees(false,
|
*/
|
||||||
4 + par1Random.nextInt(7), 3, 3, true));
|
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
|
||||||
}
|
{
|
||||||
|
return (WorldGenerator)(par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : (par1Random.nextInt(2) == 0 ? new WorldGenHugeTrees(false, 10 + par1Random.nextInt(20), 3, 3) : new WorldGenTrees(false, 4 + par1Random.nextInt(7), 3, 3, true)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a WorldGen appropriate for this biome.
|
||||||
|
*/
|
||||||
|
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
|
||||||
|
{
|
||||||
|
return par1Random.nextInt(4) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void decorate(World par1World, Random par2Random, int par3, int par4)
|
||||||
|
{
|
||||||
|
super.decorate(par1World, par2Random, par3, par4);
|
||||||
|
WorldGenVines worldgenvines = new WorldGenVines();
|
||||||
|
|
||||||
|
for (int k = 0; k < 50; ++k)
|
||||||
|
{
|
||||||
|
int l = par3 + par2Random.nextInt(16) + 8;
|
||||||
|
byte b0 = 64;
|
||||||
|
int i1 = par4 + par2Random.nextInt(16) + 8;
|
||||||
|
worldgenvines.generate(par1World, par2Random, l, b0, i1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
23
common/MysticWorld/Biome/BiomeGenMountain.java
Normal file
23
common/MysticWorld/Biome/BiomeGenMountain.java
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
package mysticworld.biome;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.monster.EntityCreeper;
|
||||||
|
import net.minecraft.entity.monster.EntityGhast;
|
||||||
|
import net.minecraft.entity.monster.EntityGiantZombie;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import net.minecraft.world.biome.SpawnListEntry;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||||
|
|
||||||
|
public class BiomeGenMountain extends BiomeGenBase {
|
||||||
|
|
||||||
|
public BiomeGenMountain(int id, int blockTop, int blockFiller)
|
||||||
|
{
|
||||||
|
super(id);
|
||||||
|
this.topBlock = (byte) blockTop;
|
||||||
|
this.fillerBlock = (byte) blockFiller;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,13 +1,28 @@
|
||||||
package mysticworld.biome;
|
package mysticworld.biome;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import java.util.Random;
|
||||||
|
|
||||||
public class BiomeGenTundra extends BiomeGenBasic {
|
import net.minecraft.entity.monster.EntityCreeper;
|
||||||
public BiomeGenTundra(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, Block blockTop, Block blockFiller) {
|
import net.minecraft.entity.monster.EntityGhast;
|
||||||
super(id, treesChunk, grassChunk, flowerChunk, reedsChunk, blockTop, blockFiller);
|
import net.minecraft.entity.monster.EntityGiantZombie;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import net.minecraft.world.biome.SpawnListEntry;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||||
|
|
||||||
|
public class BiomeGenTundra extends BiomeGenBase {
|
||||||
|
|
||||||
|
public BiomeGenTundra(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) {
|
||||||
|
super(id);
|
||||||
|
this.topBlock = (byte) blockTop;
|
||||||
|
this.fillerBlock = (byte) blockFiller;
|
||||||
|
this.theBiomeDecorator.treesPerChunk = treesChunk;
|
||||||
|
this.theBiomeDecorator.grassPerChunk = grassChunk;
|
||||||
|
this.theBiomeDecorator.flowersPerChunk = flowerChunk;
|
||||||
|
this.theBiomeDecorator.reedsPerChunk = reedsChunk;;
|
||||||
this.spawnableCreatureList.clear();
|
this.spawnableCreatureList.clear();
|
||||||
this.spawnableMonsterList.clear();
|
this.spawnableMonsterList.clear();
|
||||||
this.spawnableWaterCreatureList.clear();
|
this.spawnableWaterCreatureList.clear();
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(net.minecraft.entity.passive.EntityWolf.class, 5, 4, 4));
|
this.spawnableCreatureList.add(new SpawnListEntry(net.minecraft.entity.passive.EntityWolf.class, 5, 4, 4));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
package mysticworld.biome;
|
package mysticworld.biome;
|
||||||
|
|
||||||
import mysticworld.lib.Booleans;
|
import mysticworld.lib.Booleans;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
import net.minecraftforge.common.BiomeManager;
|
import net.minecraftforge.common.BiomeManager;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class BiomeHandler {
|
public class BiomeHandler {
|
||||||
public static BiomeGenBase Mountain;
|
public static BiomeGenBase Mountain;
|
||||||
|
|
@ -12,33 +13,49 @@ public class BiomeHandler {
|
||||||
public static BiomeGenBase Glacier;
|
public static BiomeGenBase Glacier;
|
||||||
public static BiomeGenBase Jungle;
|
public static BiomeGenBase Jungle;
|
||||||
|
|
||||||
public static void init(){
|
public static void init() {
|
||||||
|
initializeBiomes();
|
||||||
|
registerBiomes();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initializeBiomes() {
|
||||||
|
Mountain = new BiomeGenMountain(23, Block.stone.blockID, Block.stone.blockID).setColor(9286496).setBiomeName("Mountain").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
|
||||||
|
.setMinMaxHeight(0.5F, 1.0F);
|
||||||
|
Tundra = new BiomeGenTundra(24, 0, 0, 0, 0, Block.blockSnow.blockID, Block.blockSnow.blockID).setColor(9286496).setBiomeName("Tundra").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
|
||||||
|
.setMinMaxHeight(0.8F, 0.4F);
|
||||||
|
Steppe = new BiomeGenBasic(25, 0, 2, 2, 3, Block.grass.blockID, Block.dirt.blockID).setColor(5470985).setBiomeName("Steppe").setMinMaxHeight(0.1F, 0.1F);
|
||||||
|
Glacier = new BiomeGenGlacier(26, 0, 0, 0, 0, Block.ice.blockID, Block.ice.blockID).setColor(9474208).setBiomeName("Glacier").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
|
||||||
|
.setMinMaxHeight(0.5F, 0.7F);
|
||||||
|
Jungle = new BiomeGenJungle(27).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(0.2F, 0.4F);
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerBiomes() {
|
||||||
if (Booleans.ENABLE_JUNGLE_REWRITE) {
|
if (Booleans.ENABLE_JUNGLE_REWRITE) {
|
||||||
Jungle = new BiomeGenJungle(21).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setHeight(new BiomeGenBase.Height(0.2F, 0.4F));
|
GameRegistry.removeBiome(BiomeGenBase.jungle);
|
||||||
|
GameRegistry.removeBiome(BiomeGenBase.jungleHills);
|
||||||
|
GameRegistry.addBiome(Jungle);
|
||||||
BiomeManager.addSpawnBiome(Jungle);
|
BiomeManager.addSpawnBiome(Jungle);
|
||||||
BiomeManager.addStrongholdBiome(Jungle);
|
BiomeManager.addStrongholdBiome(Jungle);
|
||||||
}
|
}
|
||||||
|
if (Booleans.ENABLE_GLACIER_GEN) {
|
||||||
|
GameRegistry.addBiome(Glacier);
|
||||||
|
BiomeManager.addStrongholdBiome(Glacier);
|
||||||
|
}
|
||||||
if (Booleans.ENABLE_MOUNTAIN_GEN) {
|
if (Booleans.ENABLE_MOUNTAIN_GEN) {
|
||||||
Mountain = new BiomeGenBasic(53, Blocks.stone, Blocks.stone).setColor(9286496).setBiomeName("Mountain").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
|
GameRegistry.addBiome(Mountain);
|
||||||
.setHeight(new BiomeGenBase.Height(0.5F, 1.0F));
|
|
||||||
BiomeManager.addSpawnBiome(Mountain);
|
BiomeManager.addSpawnBiome(Mountain);
|
||||||
BiomeManager.addStrongholdBiome(Mountain);
|
BiomeManager.addStrongholdBiome(Mountain);
|
||||||
}
|
}
|
||||||
if (Booleans.ENABLE_TUNDRA_GEN) {
|
if (Booleans.ENABLE_TUNDRA_GEN) {
|
||||||
Tundra = new BiomeGenTundra(54, 0, 0, 0, 0, Blocks.snow, Blocks.snow).setColor(9286496).setBiomeName("Tundra").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
|
GameRegistry.addBiome(Tundra);
|
||||||
.setHeight(new BiomeGenBase.Height(0.8F, 0.4F));
|
|
||||||
BiomeManager.addStrongholdBiome(Tundra);
|
BiomeManager.addStrongholdBiome(Tundra);
|
||||||
}
|
}
|
||||||
if (Booleans.ENABLE_STEPPE_GEN) {
|
if (Booleans.ENABLE_STEPPE_GEN) {
|
||||||
Steppe = new BiomeGenBasic(55, 0, 2, 2, 3, Blocks.grass, Blocks.dirt).setColor(5470985).setBiomeName("Steppe").setHeight(new BiomeGenBase.Height(0.1F, 0.1F));
|
GameRegistry.addBiome(Steppe);
|
||||||
BiomeManager.addSpawnBiome(Steppe);
|
BiomeManager.addSpawnBiome(Steppe);
|
||||||
BiomeManager.addVillageBiome(Steppe, true);
|
BiomeManager.addVillageBiome(Steppe, true);
|
||||||
BiomeManager.addStrongholdBiome(Steppe);
|
BiomeManager.addStrongholdBiome(Steppe);
|
||||||
}
|
}
|
||||||
if (Booleans.ENABLE_GLACIER_GEN) {
|
|
||||||
Glacier = new BiomeGenGlacier(56, 0, 0, 0, 0, Blocks.ice, Blocks.ice).setColor(9474208).setBiomeName("Glacier").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
|
|
||||||
.setHeight(new BiomeGenBase.Height(0.5F, 0.7F));
|
|
||||||
BiomeManager.addStrongholdBiome(Glacier);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
170
common/MysticWorld/Blocks/BlockBush.java
Normal file
170
common/MysticWorld/Blocks/BlockBush.java
Normal file
|
|
@ -0,0 +1,170 @@
|
||||||
|
package mysticworld.blocks;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticworld.MysticWorld;
|
||||||
|
import mysticworld.items.ItemHandler;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Icon;
|
||||||
|
import net.minecraft.world.ColorizerFoliage;
|
||||||
|
import net.minecraft.world.ColorizerGrass;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.EnumPlantType;
|
||||||
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
|
import net.minecraftforge.common.IPlantable;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class BlockBush extends Block implements IPlantable {
|
||||||
|
Icon[] textures;
|
||||||
|
|
||||||
|
public BlockBush(int id) {
|
||||||
|
super(id, Material.leaves);
|
||||||
|
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
|
setHardness(0.3F);
|
||||||
|
setResistance(0.1F);
|
||||||
|
setStepSound(Block.soundGrassFootstep);
|
||||||
|
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBlockStay(World par1World, int par2, int par3, int par4) {
|
||||||
|
Block soil = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
|
||||||
|
return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World.canBlockSeeTheSky(par2, par3, par4))
|
||||||
|
&& (soil != null && soil.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Plant Specific Stuff
|
||||||
|
@Override
|
||||||
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||||
|
return super.canPlaceBlockAt(par1World, par2, par3, par4) && canBlockStay(par1World, par2, par3, par4);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
|
||||||
|
int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
|
||||||
|
return l == -1 ? 16777215 : par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(int j) {
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBlockColor() {
|
||||||
|
double d0 = 0.5D;
|
||||||
|
double d1 = 1.0D;
|
||||||
|
return ColorizerGrass.getGrassColor(d0, d1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getDamageValue(World par1World, int par2, int par3, int par4) {
|
||||||
|
return par1World.getBlockMetadata(par2, par3, par4);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Sprite Inits
|
||||||
|
@Override
|
||||||
|
public Icon getIcon(int side, int meta) {
|
||||||
|
return textures[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPlantID(World world, int x, int y, int z) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPlantMetadata(World world, int x, int y, int z) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumPlantType getPlantType(World world, int x, int y, int z) {
|
||||||
|
return EnumPlantType.Plains;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getRenderColor(int par1) {
|
||||||
|
return par1 == -1 ? 16777215 : ColorizerFoliage.getFoliageColorBasic();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||||
|
for (int j = 0; j < 12; j++) {
|
||||||
|
list.add(new ItemStack(i, 1, j));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
|
||||||
|
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int idDropped(int par1, Random par2Random, int par3) {
|
||||||
|
return ItemHandler.bushFruit.itemID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int idPicked(World par1World, int par2, int par3, int par4) {
|
||||||
|
return blockID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
||||||
|
super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
|
||||||
|
this.checkBushChange(par1World, par2, par3, par4);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Meta Inits
|
||||||
|
@Override
|
||||||
|
public int quantityDroppedWithBonus(int par1, Random par2Random) {
|
||||||
|
return 1 + par2Random.nextInt(par1 * 2 + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
textures = new Icon[16];
|
||||||
|
for (int i = 0; i < 12; i++) {
|
||||||
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemBush.BUSH_TYPES[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||||
|
this.checkBushChange(par1World, par2, par3, par4);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean canThisPlantGrowOnThisBlockID(int par1) {
|
||||||
|
return par1 == Block.grass.blockID || par1 == Block.dirt.blockID;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected final void checkBushChange(World par1World, int par2, int par3, int par4) {
|
||||||
|
if (!this.canBlockStay(par1World, par2, par3, par4)) {
|
||||||
|
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||||
|
par1World.setBlockToAir(par2, par3, par4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,25 +1,38 @@
|
||||||
package mysticworld.blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import mysticworld.lib.BlockIds;
|
||||||
import mysticworld.lib.Strings;
|
import mysticworld.lib.Strings;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
public class BlockHandler {
|
public class BlockHandler {
|
||||||
public static final ArrayList<String> IMBUED_STONE_TYPE = new ArrayList<String>(Arrays.asList(Strings.IMBUED_STONE_NAME+"Fire", Strings.IMBUED_STONE_NAME+"Water", Strings.IMBUED_STONE_NAME+"Earth", Strings.IMBUED_STONE_NAME+"Air", Strings.IMBUED_STONE_NAME+"Energy"));
|
public static Block oreImbuedStone;
|
||||||
public static final ArrayList<String> BUSH_TYPES = new ArrayList<String>(Arrays.asList(Strings.BUSH_NAME, Strings.POISON_BUSH_NAME, Strings.WEAKNESS_BUSH_NAME, Strings.SLOWNESS_BUSH_NAME, Strings.HARMING_BUSH_NAME,
|
public static Block bush;
|
||||||
Strings.WITHER_BUSH_NAME, Strings.HEALTH_BUSH_NAME, Strings.SPEED_BUSH_NAME, Strings.FIRE_RESISTANCE_BUSH_NAME, Strings.REGEN_BUSH_NAME, Strings.NIGHT_VISION_BUSH_NAME,
|
public static Block lightCube;
|
||||||
Strings.INVISIBILITY_BUSH_NAME));
|
public static Block pillarPlatform;
|
||||||
public static Block oreImbuedStone, bush, lightCube, pillarPlatform, pillar, pillarInsert;
|
public static Block pillar;
|
||||||
|
public static Block pillarInsert;
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
oreImbuedStone = GameRegistry.registerBlock(new BlockImbuedStone().setBlockName(Strings.IMBUED_STONE_NAME), ItemBlockMulti.class, Strings.IMBUED_STONE_NAME, IMBUED_STONE_TYPE);
|
oreImbuedStone = new BlockImbuedStone(BlockIds.ORE_STONE_1).setUnlocalizedName(Strings.IMBUED_STONE_NAME);
|
||||||
bush = GameRegistry.registerBlock(new BlockBushes().setBlockName(Strings.BUSH_NAME), ItemBlockMulti.class, Strings.BUSH_NAME, BUSH_TYPES);
|
bush = new BlockBush(BlockIds.BUSH).setUnlocalizedName(Strings.BUSH_NAME);
|
||||||
lightCube = GameRegistry.registerBlock(new BlockLightCube().setBlockName(Strings.LIGHT_CUBE_NAME).setBlockTextureName("mysticworld:lightCube"), Strings.LIGHT_CUBE_NAME);
|
lightCube = new BlockLightCube(BlockIds.LIGHT_CUBE).setUnlocalizedName(Strings.LIGHT_CUBE_NAME);
|
||||||
pillarPlatform = GameRegistry.registerBlock(new BlockPlatform().setBlockName(Strings.PLATFORM_NAME).setBlockTextureName("mysticworld:Platform"), Strings.PLATFORM_NAME);
|
pillarPlatform = new BlockPlatform(BlockIds.PLATFORM).setUnlocalizedName(Strings.PLATFORM_NAME);
|
||||||
pillar = GameRegistry.registerBlock(new BlockPillar().setBlockName(Strings.PILLAR_NAME).setBlockTextureName("mysticworld:Pillar"), Strings.PILLAR_NAME);
|
pillar = new BlockPillar(BlockIds.PILLAR).setUnlocalizedName(Strings.PILLAR_NAME);
|
||||||
pillarInsert = GameRegistry.registerBlock(new BlockPillarInsert().setBlockName(Strings.PILLAR_INSERT_NAME), Strings.PILLAR_INSERT_NAME);
|
pillarInsert = new BlockPillarInsert(BlockIds.PILLAR_INSERT).setUnlocalizedName(Strings.PILLAR_INSERT_NAME);
|
||||||
|
registerBlocks();
|
||||||
|
setBlockHarvestLevels();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void registerBlocks() {
|
||||||
|
GameRegistry.registerBlock(oreImbuedStone, ItemImbuedStone.class, Strings.IMBUED_STONE_NAME);
|
||||||
|
GameRegistry.registerBlock(bush, ItemBush.class, Strings.BUSH_NAME);
|
||||||
|
GameRegistry.registerBlock(lightCube, Strings.LIGHT_CUBE_NAME);
|
||||||
|
GameRegistry.registerBlock(pillarPlatform, Strings.PLATFORM_NAME);
|
||||||
|
GameRegistry.registerBlock(pillar, Strings.PILLAR_NAME);
|
||||||
|
GameRegistry.registerBlock(pillarInsert, Strings.PILLAR_INSERT_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setBlockHarvestLevels() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,36 @@
|
||||||
package mysticworld.blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import java.util.List;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import java.util.Random;
|
||||||
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import mysticworld.items.ItemHandler;
|
import mysticworld.items.ItemHandler;
|
||||||
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;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import java.util.List;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class BlockImbuedStone extends Block {
|
public class BlockImbuedStone extends Block {
|
||||||
IIcon[] textures;
|
Icon[] textures;
|
||||||
|
|
||||||
public BlockImbuedStone() {
|
public BlockImbuedStone(int ID) {
|
||||||
super(Material.rock);
|
super(ID, Material.rock);
|
||||||
setHardness(0.5F);
|
setHardness(0.5F);
|
||||||
setResistance(5F);
|
setResistance(5F);
|
||||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.125F, 0.75F);
|
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.125F, 0.75F);
|
||||||
setLightLevel(0.625f);
|
setLightValue(0.625f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||||
return World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4);
|
return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -45,22 +44,30 @@ public class BlockImbuedStone extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public Icon getIcon(int side, int meta) {
|
||||||
public IIcon getIcon(int side, int meta) {
|
|
||||||
return textures[meta];
|
return textures[meta];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||||
public void getSubBlocks(Item i, CreativeTabs tab, List list) {
|
|
||||||
for (int j = 0; j < 5; j++) {
|
for (int j = 0; j < 5; j++) {
|
||||||
list.add(new ItemStack(i, 1, j));
|
list.add(new ItemStack(i, 1, j));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int par1, Random par2Random, int par3) {
|
public int idDropped(int par1, Random par2Random, int par3) {
|
||||||
return ItemHandler.imbuedShard;
|
return ItemHandler.imbuedShard.itemID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int idPicked(World par1World, int par2, int par3, int par4) {
|
||||||
|
return blockID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -69,9 +76,9 @@ public class BlockImbuedStone extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) {
|
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) && !BlockFence.func_149825_a(par1World.getBlock(par2, par3 - 1, par4))) {
|
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4))) {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
if (flag) {
|
if (flag) {
|
||||||
|
|
@ -82,24 +89,24 @@ public class BlockImbuedStone extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
textures = new IIcon[16];
|
textures = new Icon[16];
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
textures[i] = iconRegister.registerIcon("mysticworld:" + BlockHandler.IMBUED_STONE_TYPE.get(i).substring(11) + " Imbued Stone");
|
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemImbuedStone.IMBUED_STONE_TYPE[i] + " Imbued Stone");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
public boolean renderAsNormalBlock() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int xpDropAmount(int j) {
|
public int xpDropAmount(int j) {
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean canSilkHarvest() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,42 +1,52 @@
|
||||||
package mysticworld.blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticworld.MysticWorld;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockLightCube extends Block {
|
public class BlockLightCube extends Block {
|
||||||
public BlockLightCube() {
|
public BlockLightCube(int id) {
|
||||||
super(Material.circuits);
|
super(id, Material.circuits);
|
||||||
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||||
setLightLevel(1.0F);
|
setLightValue(1.0F);
|
||||||
setTickRandomly(true);
|
this.setTickRandomly(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int par1, Random par2Random, int par3) {
|
public int idDropped(int par1, Random par2Random, int par3) {
|
||||||
return null;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||||
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
||||||
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
@SideOnly(Side.CLIENT)
|
||||||
return false;
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
}
|
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "lightCube");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(){
|
public boolean renderAsNormalBlock() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean canSilkHarvest() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,23 +3,32 @@ package mysticworld.blocks;
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
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.IconRegister;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockPillar extends Block {
|
public class BlockPillar extends Block {
|
||||||
public BlockPillar() {
|
public BlockPillar(int id) {
|
||||||
super(Material.rock);
|
super(id, Material.rock);
|
||||||
setBlockUnbreakable();
|
setBlockUnbreakable();
|
||||||
setResistance(6000000.0F);
|
setResistance(6000000.0F);
|
||||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(){
|
public boolean isOpaqueCube() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
@SideOnly(Side.CLIENT)
|
||||||
return false;
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
}
|
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "Pillar");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,32 @@
|
||||||
package mysticworld.blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import mysticworld.tiles.TileEntityPillarInsert;
|
import mysticworld.tiles.TileEntityPillarInsert;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockPillarInsert extends Block {
|
public class BlockPillarInsert extends BlockContainer {
|
||||||
public static int RENDER_PILLAR_INSERT;
|
public static int RENDER_PILLAR_INSERT;
|
||||||
|
|
||||||
public BlockPillarInsert() {
|
public BlockPillarInsert(int id) {
|
||||||
super(Material.rock);
|
super(id, Material.rock);
|
||||||
this.setBlockUnbreakable();
|
this.setBlockUnbreakable();
|
||||||
this.setResistance(6000000.0F);
|
this.setResistance(6000000.0F);
|
||||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F);
|
setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasTileEntity(int i){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createTileEntity(World world, int i) {
|
public TileEntity createNewTileEntity(World world) {
|
||||||
return new TileEntityPillarInsert();
|
return new TileEntityPillarInsert();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public int getRenderBlockPass() {
|
public int getRenderBlockPass() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
@ -45,33 +36,27 @@ public class BlockPillarInsert extends Block {
|
||||||
return RENDER_PILLAR_INSERT;
|
return RENDER_PILLAR_INSERT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
if (Items.ender_pearl == entityPlayer.inventory.getCurrentItem().getItem()) {
|
if (Item.enderPearl.itemID == entityPlayer.inventory.getCurrentItem().itemID) {
|
||||||
TileEntity te = world.getTileEntity(x, y, z);
|
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public boolean renderAsNormalBlock() {
|
||||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int i) {
|
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int i) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,26 @@
|
||||||
package mysticworld.blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import java.util.Random;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
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.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class BlockPillarPlatform extends Block {
|
public class BlockPillarPlatform extends Block {
|
||||||
public BlockPillarPlatform() {
|
public BlockPillarPlatform(int id) {
|
||||||
super(Material.rock);
|
super(id, Material.rock);
|
||||||
this.setBlockUnbreakable();
|
this.setBlockUnbreakable();
|
||||||
this.setResistance(6000000.0F);
|
this.setResistance(6000000.0F);
|
||||||
this.setTickRandomly(true);
|
this.setTickRandomly(true);
|
||||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -28,7 +31,6 @@ public class BlockPillarPlatform extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||||
double posX = x;
|
double posX = x;
|
||||||
double posY = y;
|
double posY = y;
|
||||||
|
|
@ -38,15 +40,10 @@ public class BlockPillarPlatform extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
public boolean renderAsNormalBlock() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube(){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int tickRate(World par1World) {
|
public int tickRate(World par1World) {
|
||||||
|
|
@ -60,11 +57,11 @@ public class BlockPillarPlatform extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTowersNearby(World world, int x, int y, int z) {
|
private boolean isTowersNearby(World world, int x, int y, int z) {
|
||||||
Block block = BlockHandler.pillar;
|
int block = BlockHandler.pillar.blockID;
|
||||||
if (world.getBlock(x - 2, y, z - 2) == block && world.getBlock(x - 2, y, z + 2) == block && world.getBlock(x + 2, y, z + 2) == block && world.getBlock(x + 2, y, z - 2) == block
|
if (world.getBlockId(x - 2, y, z - 2) == block && world.getBlockId(x - 2, y, z + 2) == block && world.getBlockId(x + 2, y, z + 2) == block && world.getBlockId(x + 2, y, z - 2) == block
|
||||||
&& world.getBlock(x - 2, y + 1, z - 2) == block && world.getBlock(x - 2, y + 1, z + 2) == block && world.getBlock(x + 2, y + 1, z + 2) == block
|
&& world.getBlockId(x - 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 1, z + 2) == block && world.getBlockId(x + 2, y + 1, z + 2) == block
|
||||||
&& world.getBlock(x + 2, y + 1, z - 2) == block && world.getBlock(x - 2, y + 2, z - 2) == block && world.getBlock(x - 2, y + 2, z + 2) == block
|
&& world.getBlockId(x + 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 2, z - 2) == block && world.getBlockId(x - 2, y + 2, z + 2) == block
|
||||||
&& world.getBlock(x + 2, y + 2, z + 2) == block && world.getBlock(x + 2, y + 2, z - 2) == block) {
|
&& world.getBlockId(x + 2, y + 2, z + 2) == block && world.getBlockId(x + 2, y + 2, z - 2) == block) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -5,21 +5,21 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockPillarTower extends Block {
|
public class BlockPillarTower extends Block {
|
||||||
public BlockPillarTower() {
|
public BlockPillarTower(int id) {
|
||||||
super(Material.rock);
|
super(id, Material.rock);
|
||||||
setBlockUnbreakable();
|
setBlockUnbreakable();
|
||||||
setResistance(6000000.0F);
|
setResistance(6000000.0F);
|
||||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(){
|
public boolean isOpaqueCube() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
public boolean renderAsNormalBlock() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,39 @@
|
||||||
package mysticworld.blocks;
|
package mysticworld.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticworld.MysticWorld;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockPlatform extends Block {
|
public class BlockPlatform extends Block {
|
||||||
public BlockPlatform() {
|
public BlockPlatform(int id) {
|
||||||
super(Material.rock);
|
super(id, Material.rock);
|
||||||
setBlockUnbreakable();
|
this.setBlockUnbreakable();
|
||||||
setResistance(6000000.0F);
|
this.setResistance(6000000.0F);
|
||||||
setTickRandomly(true);
|
this.setTickRandomly(true);
|
||||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(){
|
public boolean isOpaqueCube() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock(){
|
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
|
||||||
return false;
|
super.onEntityWalking(world, x, y, z, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||||
|
int block = BlockHandler.pillar.blockID;
|
||||||
double posX = x;
|
double posX = x;
|
||||||
double posY = y;
|
double posY = y;
|
||||||
double posZ = z;
|
double posZ = z;
|
||||||
|
|
@ -46,6 +48,17 @@ public class BlockPlatform extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "Platform");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int tickRate(World par1World) {
|
public int tickRate(World par1World) {
|
||||||
return 30;
|
return 30;
|
||||||
|
|
@ -56,12 +69,12 @@ public class BlockPlatform extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTowersNearby(World world, int x, int y, int z) {
|
private boolean isTowersNearby(World world, int x, int y, int z) {
|
||||||
Block pillar = BlockHandler.pillar;
|
int pillar = BlockHandler.pillar.blockID;
|
||||||
Block insert = BlockHandler.pillarInsert;
|
int insert = BlockHandler.pillarInsert.blockID;
|
||||||
if (world.getBlock(x - 2, y, z - 2) == pillar && world.getBlock(x - 2, y, z + 2) == pillar && world.getBlock(x + 2, y, z + 2) == pillar && world.getBlock(x + 2, y, z - 2) == pillar
|
if (world.getBlockId(x - 2, y, z - 2) == pillar && world.getBlockId(x - 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z - 2) == pillar
|
||||||
&& world.getBlock(x - 2, y + 1, z - 2) == insert && world.getBlock(x - 2, y + 1, z + 2) == insert && world.getBlock(x + 2, y + 1, z + 2) == insert
|
&& world.getBlockId(x - 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 1, z + 2) == insert && world.getBlockId(x + 2, y + 1, z + 2) == insert
|
||||||
&& world.getBlock(x + 2, y + 1, z - 2) == insert && world.getBlock(x - 2, y + 2, z - 2) == pillar && world.getBlock(x - 2, y + 2, z + 2) == pillar
|
&& world.getBlockId(x + 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 2, z - 2) == pillar && world.getBlockId(x - 2, y + 2, z + 2) == pillar
|
||||||
&& world.getBlock(x + 2, y + 2, z + 2) == pillar && world.getBlock(x + 2, y + 2, z - 2) == pillar) {
|
&& world.getBlockId(x + 2, y + 2, z + 2) == pillar && world.getBlockId(x + 2, y + 2, z - 2) == pillar) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
38
common/MysticWorld/Blocks/ItemBush.java
Normal file
38
common/MysticWorld/Blocks/ItemBush.java
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
package mysticworld.blocks;
|
||||||
|
|
||||||
|
import mysticworld.lib.Strings;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Icon;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class ItemBush extends ItemBlock {
|
||||||
|
public static String[] BUSH_TYPES = new String[] { Strings.BUSH_NAME, Strings.POISON_BUSH_NAME, Strings.WEAKNESS_BUSH_NAME, Strings.SLOWNESS_BUSH_NAME, Strings.HARMING_BUSH_NAME,
|
||||||
|
Strings.WITHER_BUSH_NAME, Strings.HEALTH_BUSH_NAME, Strings.SPEED_BUSH_NAME, Strings.FIRE_RESISTANCE_BUSH_NAME, Strings.REGEN_BUSH_NAME, Strings.NIGHT_VISION_BUSH_NAME,
|
||||||
|
Strings.INVISIBILITY_BUSH_NAME };
|
||||||
|
|
||||||
|
public ItemBush(int par1) {
|
||||||
|
super(par1);
|
||||||
|
setMaxDamage(0);
|
||||||
|
setHasSubtypes(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Icon getIconFromDamage(int par1) {
|
||||||
|
return BlockHandler.bush.getIcon(2, par1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int par1) {
|
||||||
|
return par1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BUSH_TYPES.length);
|
||||||
|
return BUSH_TYPES[meta];
|
||||||
|
}
|
||||||
|
}
|
||||||
43
common/MysticWorld/Blocks/ItemImbuedStone.java
Normal file
43
common/MysticWorld/Blocks/ItemImbuedStone.java
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
package mysticworld.blocks;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Icon;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
|
||||||
|
public class ItemImbuedStone extends ItemBlock {
|
||||||
|
|
||||||
|
public static String[] IMBUED_STONE_TYPE = new String[] {"Fire", "Water", "Earth", "Air", "Energy"};
|
||||||
|
|
||||||
|
public ItemImbuedStone(int par1) {
|
||||||
|
super(par1);
|
||||||
|
setMaxDamage(0);
|
||||||
|
setHasSubtypes(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, IMBUED_STONE_TYPE.length);
|
||||||
|
return super.getUnlocalizedName() + IMBUED_STONE_TYPE[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getMetadata(int par1)
|
||||||
|
{
|
||||||
|
return par1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Icon getIconFromDamage(int par1)
|
||||||
|
{
|
||||||
|
return BlockHandler.oreImbuedStone.getIcon(2, par1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,49 +1,70 @@
|
||||||
package mysticworld.client;
|
package mysticworld.client;
|
||||||
|
|
||||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
|
||||||
import mysticworld.CommonProxy;
|
|
||||||
import mysticworld.blocks.BlockHandler;
|
import mysticworld.blocks.BlockHandler;
|
||||||
import mysticworld.blocks.BlockPillarInsert;
|
import mysticworld.blocks.BlockPillarInsert;
|
||||||
import mysticworld.client.fx.LightCubeFX;
|
import mysticworld.client.fx.LightCubeFX;
|
||||||
import mysticworld.client.fx.PowerAirFX;
|
import mysticworld.client.fx.PowerAirFX;
|
||||||
import mysticworld.client.fx.PowerFX;
|
import mysticworld.client.fx.PowerEarthFX;
|
||||||
import mysticworld.entity.*;
|
import mysticworld.client.fx.PowerEnergyFX;
|
||||||
|
import mysticworld.client.fx.PowerFireFX;
|
||||||
|
import mysticworld.client.fx.PowerWaterFX;
|
||||||
|
import mysticworld.entity.EntityChargeAir;
|
||||||
|
import mysticworld.entity.EntityChargeEarth;
|
||||||
|
import mysticworld.entity.EntityChargeEnergy;
|
||||||
|
import mysticworld.entity.EntityChargeFire;
|
||||||
|
import mysticworld.entity.EntityChargeWater;
|
||||||
import mysticworld.items.ItemHandler;
|
import mysticworld.items.ItemHandler;
|
||||||
import mysticworld.renderer.*;
|
import mysticworld.renderer.BlockPillarInsertRenderer;
|
||||||
|
import mysticworld.renderer.ItemOrbAirRenderer;
|
||||||
|
import mysticworld.renderer.ItemOrbEarthRenderer;
|
||||||
|
import mysticworld.renderer.ItemOrbEnergyRenderer;
|
||||||
|
import mysticworld.renderer.ItemOrbFireRenderer;
|
||||||
|
import mysticworld.renderer.ItemOrbWaterRenderer;
|
||||||
|
import mysticworld.renderer.ItemStaffAirRenderer;
|
||||||
|
import mysticworld.renderer.ItemStaffEarthRenderer;
|
||||||
|
import mysticworld.renderer.ItemStaffEnergyRenderer;
|
||||||
|
import mysticworld.renderer.ItemStaffFireRenderer;
|
||||||
|
import mysticworld.renderer.ItemStaffWaterRenderer;
|
||||||
|
import mysticworld.renderer.RenderStaffPower;
|
||||||
|
import mysticworld.renderer.TileEntityPillarInsertRenderer;
|
||||||
import mysticworld.tiles.TileEntityPillarInsert;
|
import mysticworld.tiles.TileEntityPillarInsert;
|
||||||
|
import mysticworld.util.CommonProxy;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.client.MinecraftForgeClient;
|
import net.minecraftforge.client.MinecraftForgeClient;
|
||||||
|
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||||
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
|
||||||
public class ClientProxy extends CommonProxy {
|
public class ClientProxy extends CommonProxy {
|
||||||
public final Minecraft mc = Minecraft.getMinecraft();
|
public final Minecraft mc = Minecraft.getMinecraft();
|
||||||
public static final ResourceLocation particle = new ResourceLocation("textures/particle/particles.png");
|
|
||||||
|
@Override
|
||||||
|
public int addArmor(String armor) {
|
||||||
|
return RenderingRegistry.addNewArmourRendererPrefix(armor);
|
||||||
|
}
|
||||||
|
|
||||||
//particles
|
//particles
|
||||||
@Override
|
@Override
|
||||||
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age) {
|
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age) {
|
||||||
PowerFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
|
PowerAirFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
|
||||||
mc.effectRenderer.addEffect(airFX);
|
mc.effectRenderer.addEffect(airFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void earthFX(World worldObj, double x, double y, double z, float scale) {
|
public void earthFX(World worldObj, double x, double y, double z, float scale) {
|
||||||
PowerFX earthFX = new PowerFX(worldObj, x, y, z, scale).setTexture("earth");
|
PowerEarthFX earthFX = new PowerEarthFX(worldObj, x, y, z, scale);
|
||||||
mc.effectRenderer.addEffect(earthFX);
|
mc.effectRenderer.addEffect(earthFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void energyFX(World worldObj, double x, double y, double z, float scale) {
|
public void energyFX(World worldObj, double x, double y, double z, float scale) {
|
||||||
PowerFX energyFX = new PowerFX(worldObj, x, y, z, scale).setTexture("energy");
|
PowerEnergyFX energyFX = new PowerEnergyFX(worldObj, x, y, z, scale);
|
||||||
mc.effectRenderer.addEffect(energyFX);
|
mc.effectRenderer.addEffect(energyFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fireFX(World worldObj, double x, double y, double z, float scale) {
|
public void fireFX(World worldObj, double x, double y, double z, float scale) {
|
||||||
PowerFX fireFX = new PowerFX(worldObj, x, y, z, scale).setTexture("fire");
|
PowerFireFX fireFX = new PowerFireFX(worldObj, x, y, z, scale);
|
||||||
mc.effectRenderer.addEffect(fireFX);
|
mc.effectRenderer.addEffect(fireFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,28 +77,28 @@ public class ClientProxy extends CommonProxy {
|
||||||
@Override
|
@Override
|
||||||
public void registerRenders() {
|
public void registerRenders() {
|
||||||
BlockPillarInsert.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId();
|
BlockPillarInsert.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId();
|
||||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockHandler.pillarInsert), new BlockPillarInsertRenderer());
|
MinecraftForgeClient.registerItemRenderer(BlockHandler.pillarInsert.blockID, new BlockPillarInsertRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff, new StaffItemRenderer("Fire"));
|
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff.itemID, new ItemStaffFireRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff, new StaffItemRenderer("Water"));
|
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff.itemID, new ItemStaffEarthRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff, new StaffItemRenderer("Earth"));
|
MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff.itemID, new ItemStaffAirRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff, new StaffItemRenderer("Air"));
|
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff.itemID, new ItemStaffEnergyRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff, new StaffItemRenderer("Energy"));
|
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff.itemID, new ItemStaffWaterRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb, new OrbItemRenderer("Fire"));
|
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb.itemID, new ItemOrbFireRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb, new OrbItemRenderer("Water"));
|
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb.itemID, new ItemOrbEarthRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb, new OrbItemRenderer("Earth"));
|
MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb.itemID, new ItemOrbAirRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb, new OrbItemRenderer("Air"));
|
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb.itemID, new ItemOrbEnergyRenderer());
|
||||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb, new OrbItemRenderer("Energy"));
|
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb.itemID, new ItemOrbWaterRenderer());
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower("Fire"));
|
RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower(0));
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower("Water"));
|
RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower(1));
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower("Earth"));
|
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower(2));
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeAir.class, new RenderStaffPower("Air"));
|
RenderingRegistry.registerEntityRenderingHandler(EntityChargeAir.class, new RenderStaffPower(3));
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEnergy.class, new RenderStaffPower("Energy"));
|
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEnergy.class, new RenderStaffPower(4));
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPillarInsert.class, new TileEntityPillarInsertRenderer());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPillarInsert.class, new TileEntityPillarInsertRenderer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void waterFX(World worldObj, double x, double y, double z, float scale) {
|
public void waterFX(World worldObj, double x, double y, double z, float scale) {
|
||||||
PowerFX waterFX = new PowerFX(worldObj, x, y, z, scale).setTexture("water");
|
PowerWaterFX waterFX = new PowerWaterFX(worldObj, x, y, z, scale);
|
||||||
mc.effectRenderer.addEffect(waterFX);
|
mc.effectRenderer.addEffect(waterFX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,21 @@
|
||||||
package mysticworld.client.fx;
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class LightCubeFX extends PowerFX {
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
|
public class LightCubeFX extends EntityFX {
|
||||||
public LightCubeFX(World world, double x, double y, double z) {
|
public LightCubeFX(World world, double x, double y, double z) {
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
this.setTexture("lightCube");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LightCubeFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
|
public LightCubeFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
|
||||||
this(world, x, y, z);
|
super(world, x, y, z);
|
||||||
this.motionX *= 0.10000000149011612D;
|
this.motionX *= 0.10000000149011612D;
|
||||||
this.motionY *= 0.10000000149011612D;
|
this.motionY *= 0.10000000149011612D;
|
||||||
this.motionZ *= 0.10000000149011612D;
|
this.motionZ *= 0.10000000149011612D;
|
||||||
|
|
@ -23,4 +29,55 @@ public class LightCubeFX extends PowerFX {
|
||||||
this.noClip = true;
|
this.noClip = true;
|
||||||
this.particleMaxAge = rand.nextInt(25);
|
this.particleMaxAge = rand.nextInt(25);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
this.prevPosX = this.posX;
|
||||||
|
this.prevPosY = this.posY;
|
||||||
|
this.prevPosZ = this.posZ;
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
this.motionY += 0.004D;
|
||||||
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
if (this.posY == this.prevPosY) {
|
||||||
|
this.motionX *= 1.1D;
|
||||||
|
this.motionZ *= 1.1D;
|
||||||
|
}
|
||||||
|
this.motionX *= 0.9599999785423279D;
|
||||||
|
this.motionY *= 0.9599999785423279D;
|
||||||
|
this.motionZ *= 0.9599999785423279D;
|
||||||
|
if (this.onGround) {
|
||||||
|
this.motionX *= 0.699999988079071D;
|
||||||
|
this.motionZ *= 0.699999988079071D;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
|
tessellator.draw();
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glDepthMask(false);
|
||||||
|
GL11.glEnable(3042);
|
||||||
|
GL11.glBlendFunc(770, 1);
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/lightCubeFX.png"));
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
|
float scale = 0.1F * this.particleScale;
|
||||||
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
|
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
|
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setBrightness(240);
|
||||||
|
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||||
|
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||||
|
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||||
|
tessellator.draw();
|
||||||
|
GL11.glDisable(3042);
|
||||||
|
GL11.glDepthMask(true);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,22 @@
|
||||||
package mysticworld.client.fx;
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class PowerAirFX extends PowerFX {
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
|
public class PowerAirFX extends EntityFX {
|
||||||
public PowerAirFX(World world, double x, double y, double z) {
|
public PowerAirFX(World world, double x, double y, double z) {
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
this.setTexture("air");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerAirFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float rotPitch, float rotYaw) {
|
public PowerAirFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float rotPitch, float rotYaw) {
|
||||||
this(world, x, y, z);
|
super(world, x, y, z);
|
||||||
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
|
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
|
||||||
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
|
@ -25,7 +31,7 @@ public class PowerAirFX extends PowerFX {
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerAirFX(World world, double x, double y, double z, float scale, int age) {
|
public PowerAirFX(World world, double x, double y, double z, float scale, int age) {
|
||||||
this(world, x, y, z);
|
super(world, x, y, z);
|
||||||
this.motionX += motionX;
|
this.motionX += motionX;
|
||||||
this.motionY += motionY;
|
this.motionY += motionY;
|
||||||
this.motionZ += motionZ;
|
this.motionZ += motionZ;
|
||||||
|
|
@ -42,10 +48,56 @@ public class PowerAirFX extends PowerFX {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate() {
|
public void onUpdate() {
|
||||||
super.onUpdate();
|
this.prevPosX = this.posX;
|
||||||
|
this.prevPosY = this.posY;
|
||||||
|
this.prevPosZ = this.posZ;
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
this.motionY += 0.004D;
|
||||||
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
if (this.posY == this.prevPosY) {
|
||||||
|
this.motionX *= 1.1D;
|
||||||
|
this.motionZ *= 1.1D;
|
||||||
|
}
|
||||||
|
this.motionX *= 0.9599999785423279D;
|
||||||
|
this.motionY *= 0.9599999785423279D;
|
||||||
|
this.motionZ *= 0.9599999785423279D;
|
||||||
|
if (this.onGround) {
|
||||||
|
this.motionX *= 0.699999988079071D;
|
||||||
|
this.motionZ *= 0.699999988079071D;
|
||||||
|
}
|
||||||
this.posX += this.motionX;
|
this.posX += this.motionX;
|
||||||
this.posY += this.motionY;
|
this.posY += this.motionY;
|
||||||
this.posZ += this.motionZ;
|
this.posZ += this.motionZ;
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
|
tessellator.draw();
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glDepthMask(false);
|
||||||
|
GL11.glEnable(3042);
|
||||||
|
GL11.glBlendFunc(770, 1);
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/airFX.png"));
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
|
float scale = 0.1F * this.particleScale;
|
||||||
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
|
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
|
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setBrightness(240);
|
||||||
|
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||||
|
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||||
|
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||||
|
tessellator.draw();
|
||||||
|
GL11.glDisable(3042);
|
||||||
|
GL11.glDepthMask(true);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,21 +1,20 @@
|
||||||
package mysticworld.client.fx;
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
|
||||||
import mysticworld.client.ClientProxy;
|
|
||||||
import net.minecraft.client.particle.EntityFX;
|
import net.minecraft.client.particle.EntityFX;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
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 org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public class PowerFX extends EntityFX {
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
private ResourceLocation textureFX;
|
|
||||||
|
|
||||||
public PowerFX(World world, double x, double y, double z) {
|
public class PowerEarthFX extends EntityFX {
|
||||||
|
public PowerEarthFX(World world, double x, double y, double z) {
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerFX(World world, double x, double y, double z, float scale) {
|
public PowerEarthFX(World world, double x, double y, double z, float scale) {
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
this.motionX *= 0.019999999552965164D;
|
this.motionX *= 0.019999999552965164D;
|
||||||
this.motionY *= 0.019999999552965164D;
|
this.motionY *= 0.019999999552965164D;
|
||||||
|
|
@ -61,7 +60,7 @@ public class PowerFX extends EntityFX {
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
GL11.glEnable(3042);
|
GL11.glEnable(3042);
|
||||||
GL11.glBlendFunc(770, 1);
|
GL11.glBlendFunc(770, 1);
|
||||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(textureFX);
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/earthFX.png"));
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
float scale = 0.1F * this.particleScale;
|
float scale = 0.1F * this.particleScale;
|
||||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
|
|
@ -78,12 +77,7 @@ public class PowerFX extends EntityFX {
|
||||||
GL11.glDisable(3042);
|
GL11.glDisable(3042);
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerFX setTexture(String loc) {
|
|
||||||
textureFX = new ResourceLocation("mysticworld", "textures/misc/" + loc + "FX.png");
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
83
common/MysticWorld/Client/FX/PowerEnergyFX.java
Normal file
83
common/MysticWorld/Client/FX/PowerEnergyFX.java
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
|
public class PowerEnergyFX extends EntityFX {
|
||||||
|
public PowerEnergyFX(World world, double x, double y, double z) {
|
||||||
|
super(world, x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PowerEnergyFX(World world, double x, double y, double z, float scale) {
|
||||||
|
super(world, x, y, z);
|
||||||
|
this.motionX *= 0.019999999552965164D;
|
||||||
|
this.motionY *= 0.019999999552965164D;
|
||||||
|
this.motionZ *= 0.019999999552965164D;
|
||||||
|
this.motionX += motionX;
|
||||||
|
this.motionY += motionY;
|
||||||
|
this.motionZ += motionZ;
|
||||||
|
this.particleRed = 1.0F;
|
||||||
|
this.particleGreen = 1.0F;
|
||||||
|
this.particleBlue = 1.0F;
|
||||||
|
this.particleScale = scale;
|
||||||
|
this.noClip = true;
|
||||||
|
this.particleMaxAge = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
this.prevPosX = this.posX;
|
||||||
|
this.prevPosY = this.posY;
|
||||||
|
this.prevPosZ = this.posZ;
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
this.motionY += 0.004D;
|
||||||
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
if (this.posY == this.prevPosY) {
|
||||||
|
this.motionX *= 1.1D;
|
||||||
|
this.motionZ *= 1.1D;
|
||||||
|
}
|
||||||
|
this.motionX *= 0.9599999785423279D;
|
||||||
|
this.motionY *= 0.9599999785423279D;
|
||||||
|
this.motionZ *= 0.9599999785423279D;
|
||||||
|
if (this.onGround) {
|
||||||
|
this.motionX *= 0.699999988079071D;
|
||||||
|
this.motionZ *= 0.699999988079071D;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
|
tessellator.draw();
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glDepthMask(false);
|
||||||
|
GL11.glEnable(3042);
|
||||||
|
GL11.glBlendFunc(770, 1);
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/energyFX.png"));
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
|
float scale = 0.1F * this.particleScale;
|
||||||
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
|
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
|
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setBrightness(240);
|
||||||
|
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||||
|
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||||
|
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||||
|
tessellator.draw();
|
||||||
|
GL11.glDisable(3042);
|
||||||
|
GL11.glDepthMask(true);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
}
|
||||||
|
}
|
||||||
83
common/MysticWorld/Client/FX/PowerFireFX.java
Normal file
83
common/MysticWorld/Client/FX/PowerFireFX.java
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
|
public class PowerFireFX extends EntityFX {
|
||||||
|
public PowerFireFX(World world, double x, double y, double z) {
|
||||||
|
super(world, x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PowerFireFX(World world, double x, double y, double z, float scale) {
|
||||||
|
super(world, x, y, z);
|
||||||
|
this.motionX *= 0.019999999552965164D;
|
||||||
|
this.motionY *= 0.019999999552965164D;
|
||||||
|
this.motionZ *= 0.019999999552965164D;
|
||||||
|
this.motionX += motionX;
|
||||||
|
this.motionY += motionY;
|
||||||
|
this.motionZ += motionZ;
|
||||||
|
this.particleRed = 1.0F;
|
||||||
|
this.particleGreen = 1.0F;
|
||||||
|
this.particleBlue = 1.0F;
|
||||||
|
this.particleScale = scale;
|
||||||
|
this.noClip = true;
|
||||||
|
this.particleMaxAge = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
this.prevPosX = this.posX;
|
||||||
|
this.prevPosY = this.posY;
|
||||||
|
this.prevPosZ = this.posZ;
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
this.motionY += 0.004D;
|
||||||
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
if (this.posY == this.prevPosY) {
|
||||||
|
this.motionX *= 1.1D;
|
||||||
|
this.motionZ *= 1.1D;
|
||||||
|
}
|
||||||
|
this.motionX *= 0.9599999785423279D;
|
||||||
|
this.motionY *= 0.9599999785423279D;
|
||||||
|
this.motionZ *= 0.9599999785423279D;
|
||||||
|
if (this.onGround) {
|
||||||
|
this.motionX *= 0.699999988079071D;
|
||||||
|
this.motionZ *= 0.699999988079071D;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
|
tessellator.draw();
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glDepthMask(false);
|
||||||
|
GL11.glEnable(3042);
|
||||||
|
GL11.glBlendFunc(770, 1);
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/fireFX.png"));
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
|
float scale = 0.1F * this.particleScale;
|
||||||
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
|
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
|
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setBrightness(240);
|
||||||
|
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||||
|
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||||
|
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||||
|
tessellator.draw();
|
||||||
|
GL11.glDisable(3042);
|
||||||
|
GL11.glDepthMask(true);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
}
|
||||||
|
}
|
||||||
83
common/MysticWorld/Client/FX/PowerWaterFX.java
Normal file
83
common/MysticWorld/Client/FX/PowerWaterFX.java
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
package mysticworld.client.fx;
|
||||||
|
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
|
public class PowerWaterFX extends EntityFX {
|
||||||
|
public PowerWaterFX(World world, double x, double y, double z) {
|
||||||
|
super(world, x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PowerWaterFX(World world, double x, double y, double z, float scale) {
|
||||||
|
super(world, x, y, z);
|
||||||
|
this.motionX *= 0.019999999552965164D;
|
||||||
|
this.motionY *= 0.019999999552965164D;
|
||||||
|
this.motionZ *= 0.019999999552965164D;
|
||||||
|
this.motionX += motionX;
|
||||||
|
this.motionY += motionY;
|
||||||
|
this.motionZ += motionZ;
|
||||||
|
this.particleRed = 1.0F;
|
||||||
|
this.particleGreen = 1.0F;
|
||||||
|
this.particleBlue = 1.0F;
|
||||||
|
this.particleScale = scale;
|
||||||
|
this.noClip = true;
|
||||||
|
this.particleMaxAge = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
this.prevPosX = this.posX;
|
||||||
|
this.prevPosY = this.posY;
|
||||||
|
this.prevPosZ = this.posZ;
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
this.motionY += 0.004D;
|
||||||
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
if (this.posY == this.prevPosY) {
|
||||||
|
this.motionX *= 1.1D;
|
||||||
|
this.motionZ *= 1.1D;
|
||||||
|
}
|
||||||
|
this.motionX *= 0.9599999785423279D;
|
||||||
|
this.motionY *= 0.9599999785423279D;
|
||||||
|
this.motionZ *= 0.9599999785423279D;
|
||||||
|
if (this.onGround) {
|
||||||
|
this.motionX *= 0.699999988079071D;
|
||||||
|
this.motionZ *= 0.699999988079071D;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||||
|
tessellator.draw();
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glDepthMask(false);
|
||||||
|
GL11.glEnable(3042);
|
||||||
|
GL11.glBlendFunc(770, 1);
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/waterFX.png"));
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||||
|
float scale = 0.1F * this.particleScale;
|
||||||
|
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||||
|
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||||
|
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setBrightness(240);
|
||||||
|
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||||
|
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||||
|
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||||
|
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||||
|
tessellator.draw();
|
||||||
|
GL11.glDisable(3042);
|
||||||
|
GL11.glDepthMask(true);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,12 +1,29 @@
|
||||||
package mysticworld.entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class EntityChargeAir extends EntityCharge {
|
public class EntityChargeAir extends Entity {
|
||||||
|
public EntityPlayer shootingEntity;
|
||||||
|
private boolean inGround = false;
|
||||||
|
private int xTile = -1;
|
||||||
|
private int yTile = -1;
|
||||||
|
private int zTile = -1;
|
||||||
|
private int inTile = 0;
|
||||||
|
private int ticksAlive;
|
||||||
|
private int ticksInAir = 0;
|
||||||
private float particleScale = 1.0f;
|
private float particleScale = 1.0f;
|
||||||
private double powerHeight = 0.75D;
|
private double powerHeight = 0.75D;
|
||||||
|
|
||||||
|
|
@ -15,19 +32,110 @@ public class EntityChargeAir extends EntityCharge {
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityChargeAir(World par1World, EntityPlayer par2EntityPlayer, float pScale, double pHeight) {
|
public EntityChargeAir(World par1World, EntityPlayer par2EntityPlayer, float pScale, double pHeight) {
|
||||||
super(par1World,par2EntityPlayer);
|
super(par1World);
|
||||||
|
this.setSize(0.25F, 0.25F);
|
||||||
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
|
||||||
|
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.shootingEntity = par2EntityPlayer;
|
||||||
this.particleScale = pScale;
|
this.particleScale = pScale;
|
||||||
this.powerHeight = pHeight;
|
this.powerHeight = pHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chargeFX() {
|
public boolean canBeCollidedWith() {
|
||||||
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), particleScale, 15);
|
return true;
|
||||||
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), particleScale, 15);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getBrightness(float par1) {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float par1) {
|
||||||
|
return 15728880;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getCollisionBorderSize() {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getShadowSize() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
|
||||||
|
this.setDead();
|
||||||
|
} else {
|
||||||
|
super.onUpdate();
|
||||||
|
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
||||||
|
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
|
}
|
||||||
|
Entity entity = null;
|
||||||
|
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||||
|
double d0 = 0.0D;
|
||||||
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
|
Entity entity1 = (Entity) list.get(j);
|
||||||
|
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
||||||
|
float f = 0.3F;
|
||||||
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
|
||||||
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
|
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
|
entity = entity1;
|
||||||
|
d0 = d1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (entity != null) {
|
||||||
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
|
}
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
this.onImpact(movingobjectposition);
|
||||||
|
}
|
||||||
|
this.posX += this.motionX;
|
||||||
|
this.posY += this.motionY;
|
||||||
|
this.posZ += this.motionZ;
|
||||||
|
float f2 = this.getMotionFactor();
|
||||||
|
if (this.isInWater()) {
|
||||||
|
for (int k = 0; k < 4; ++k) {
|
||||||
|
float f3 = 0.25F;
|
||||||
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
|
||||||
|
}
|
||||||
|
f2 = 0.8F;
|
||||||
|
}
|
||||||
|
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), particleScale, 15);
|
||||||
|
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), particleScale, 15);
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float getMotionFactor() {
|
||||||
|
return 0.95F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
|
Random rand = new Random();
|
||||||
if (!this.worldObj.isRemote) {
|
if (!this.worldObj.isRemote) {
|
||||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||||
if (par1MovingObjectPosition.entityHit != null) {
|
if (par1MovingObjectPosition.entityHit != null) {
|
||||||
|
|
@ -35,7 +143,7 @@ public class EntityChargeAir extends EntityCharge {
|
||||||
if (f3 > 0.0F) {
|
if (f3 > 0.0F) {
|
||||||
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 2 * 0.6000000238418579D / f3, 1.0D + powerHeight, this.motionZ * 2 * 0.6000000238418579D / f3);
|
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 2 * 0.6000000238418579D / f3, 1.0D + powerHeight, this.motionZ * 2 * 0.6000000238418579D / f3);
|
||||||
}
|
}
|
||||||
} /*else {
|
} else {
|
||||||
int i = par1MovingObjectPosition.blockX;
|
int i = par1MovingObjectPosition.blockX;
|
||||||
int j = par1MovingObjectPosition.blockY;
|
int j = par1MovingObjectPosition.blockY;
|
||||||
int k = par1MovingObjectPosition.blockZ;
|
int k = par1MovingObjectPosition.blockZ;
|
||||||
|
|
@ -58,8 +166,16 @@ public class EntityChargeAir extends EntityCharge {
|
||||||
case 5:
|
case 5:
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,33 +1,144 @@
|
||||||
package mysticworld.entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.boss.EntityDragon;
|
||||||
|
import net.minecraft.entity.boss.EntityWither;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.init.Items;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import java.util.Random;
|
public class EntityChargeEarth extends Entity {
|
||||||
|
public EntityPlayer shootingEntity;
|
||||||
|
public EntityPlayer entityPlayer;
|
||||||
|
public EntityDragon entityDragon;
|
||||||
|
public EntityWither entityWither;
|
||||||
|
private boolean inGround = false;
|
||||||
|
private int xTile = -1;
|
||||||
|
private int yTile = -1;
|
||||||
|
private int zTile = -1;
|
||||||
|
private int inTile = 0;
|
||||||
|
private int ticksAlive;
|
||||||
|
private int ticksInAir = 0;
|
||||||
|
|
||||||
public class EntityChargeEarth extends EntityCharge {
|
|
||||||
public EntityChargeEarth(World par1World) {
|
public EntityChargeEarth(World par1World) {
|
||||||
super(par1World);
|
super(par1World);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityChargeEarth(World par1World, EntityPlayer par2EntityPlayer) {
|
public EntityChargeEarth(World par1World, EntityPlayer par2EntityPlayer) {
|
||||||
super(par1World,par2EntityPlayer);
|
super(par1World);
|
||||||
|
this.setSize(0.25F, 0.25F);
|
||||||
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
|
||||||
|
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.shootingEntity = par2EntityPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chargeFX() {
|
public boolean canBeCollidedWith() {
|
||||||
MysticWorld.proxy.earthFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getBrightness(float par1) {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float par1) {
|
||||||
|
return 15728880;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getCollisionBorderSize() {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getShadowSize() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
|
||||||
|
this.setDead();
|
||||||
|
} else {
|
||||||
|
super.onUpdate();
|
||||||
|
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
||||||
|
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
|
}
|
||||||
|
Entity entity = null;
|
||||||
|
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||||
|
double d0 = 0.0D;
|
||||||
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
|
Entity entity1 = (Entity) list.get(j);
|
||||||
|
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
||||||
|
float f = 0.3F;
|
||||||
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
|
||||||
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
|
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
|
entity = entity1;
|
||||||
|
d0 = d1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (entity != null) {
|
||||||
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
|
}
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
this.onImpact(movingobjectposition);
|
||||||
|
}
|
||||||
|
this.posX += this.motionX;
|
||||||
|
this.posY += this.motionY;
|
||||||
|
this.posZ += this.motionZ;
|
||||||
|
float f2 = this.getMotionFactor();
|
||||||
|
if (this.isInWater()) {
|
||||||
|
for (int k = 0; k < 4; ++k) {
|
||||||
|
float f3 = 0.25F;
|
||||||
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
|
||||||
|
}
|
||||||
|
f2 = 0.8F;
|
||||||
|
}
|
||||||
|
MysticWorld.proxy.earthFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float getMotionFactor() {
|
||||||
|
return 0.95F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
if (!this.worldObj.isRemote) {
|
if (!this.worldObj.isRemote) {
|
||||||
|
|
@ -35,19 +146,19 @@ public class EntityChargeEarth extends EntityCharge {
|
||||||
if (par1MovingObjectPosition.entityHit != null) {
|
if (par1MovingObjectPosition.entityHit != null) {
|
||||||
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
if (f3 > 0.0F) {
|
if (f3 > 0.0F) {
|
||||||
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 0.6000000238418579D / f3, 0.1D, this.motionZ * 0.6000000238418579D / f3);
|
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
|
||||||
}
|
}
|
||||||
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20);
|
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20);
|
||||||
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.wheat_seeds, rand.nextInt(4))));
|
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.seeds, rand.nextInt(4))));
|
||||||
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.brown_mushroom, rand.nextInt(2))));
|
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.mushroomBrown, rand.nextInt(2))));
|
||||||
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.apple, rand.nextInt(2))));
|
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.appleRed, rand.nextInt(2))));
|
||||||
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 0)));
|
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 0)));
|
||||||
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.pumpkin_seeds, rand.nextInt(2))));
|
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.pumpkinSeeds, rand.nextInt(2))));
|
||||||
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 1)));
|
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 1)));
|
||||||
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 2)));
|
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 2)));
|
||||||
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 3)));
|
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 3)));
|
||||||
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.melon_seeds, rand.nextInt(3))));
|
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.melonSeeds, rand.nextInt(3))));
|
||||||
}/* else {
|
} else {
|
||||||
int i = par1MovingObjectPosition.blockX;
|
int i = par1MovingObjectPosition.blockX;
|
||||||
int j = par1MovingObjectPosition.blockY;
|
int j = par1MovingObjectPosition.blockY;
|
||||||
int k = par1MovingObjectPosition.blockZ;
|
int k = par1MovingObjectPosition.blockZ;
|
||||||
|
|
@ -70,8 +181,16 @@ public class EntityChargeEarth extends EntityCharge {
|
||||||
case 5:
|
case 5:
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,134 @@
|
||||||
package mysticworld.entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class EntityChargeEnergy extends Entity {
|
||||||
|
public EntityPlayer shootingEntity;
|
||||||
|
private boolean inGround = false;
|
||||||
|
private int xTile = -1;
|
||||||
|
private int yTile = -1;
|
||||||
|
private int zTile = -1;
|
||||||
|
private int inTile = 0;
|
||||||
|
private int ticksAlive;
|
||||||
|
private int ticksInAir = 0;
|
||||||
|
|
||||||
public class EntityChargeEnergy extends EntityCharge {
|
|
||||||
public EntityChargeEnergy(World par1World) {
|
public EntityChargeEnergy(World par1World) {
|
||||||
super(par1World);
|
super(par1World);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityChargeEnergy(World par1World, EntityPlayer par2EntityPlayer) {
|
public EntityChargeEnergy(World par1World, EntityPlayer par2EntityPlayer) {
|
||||||
super(par1World,par2EntityPlayer);
|
super(par1World);
|
||||||
|
this.setSize(0.25F, 0.25F);
|
||||||
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
|
||||||
|
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.shootingEntity = par2EntityPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chargeFX() {
|
public boolean canBeCollidedWith() {
|
||||||
MysticWorld.proxy.energyFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getBrightness(float par1) {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float par1) {
|
||||||
|
return 15728880;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getCollisionBorderSize() {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getShadowSize() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
|
||||||
|
this.setDead();
|
||||||
|
} else {
|
||||||
|
super.onUpdate();
|
||||||
|
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
||||||
|
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
|
}
|
||||||
|
Entity entity = null;
|
||||||
|
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||||
|
double d0 = 0.0D;
|
||||||
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
|
Entity entity1 = (Entity) list.get(j);
|
||||||
|
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
||||||
|
float f = 0.3F;
|
||||||
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
|
||||||
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
|
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
|
entity = entity1;
|
||||||
|
d0 = d1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (entity != null) {
|
||||||
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
|
}
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
this.onImpact(movingobjectposition);
|
||||||
|
}
|
||||||
|
this.posX += this.motionX;
|
||||||
|
this.posY += this.motionY;
|
||||||
|
this.posZ += this.motionZ;
|
||||||
|
float f2 = this.getMotionFactor();
|
||||||
|
if (this.isInWater()) {
|
||||||
|
for (int k = 0; k < 4; ++k) {
|
||||||
|
float f3 = 0.25F;
|
||||||
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
|
||||||
|
}
|
||||||
|
f2 = 0.8F;
|
||||||
|
}
|
||||||
|
MysticWorld.proxy.energyFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float getMotionFactor() {
|
||||||
|
return 0.95F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
int i = par1MovingObjectPosition.blockX;
|
int i = par1MovingObjectPosition.blockX;
|
||||||
int j = par1MovingObjectPosition.blockY;
|
int j = par1MovingObjectPosition.blockY;
|
||||||
|
|
@ -35,7 +142,7 @@ public class EntityChargeEnergy extends EntityCharge {
|
||||||
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, par1MovingObjectPosition.entityHit.posX, par1MovingObjectPosition.entityHit.posY, par1MovingObjectPosition.entityHit.posZ));
|
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, par1MovingObjectPosition.entityHit.posX, par1MovingObjectPosition.entityHit.posY, par1MovingObjectPosition.entityHit.posZ));
|
||||||
} else {
|
} else {
|
||||||
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, i, j, k));
|
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, i, j, k));
|
||||||
/*switch (par1MovingObjectPosition.sideHit) {
|
switch (par1MovingObjectPosition.sideHit) {
|
||||||
case 0:
|
case 0:
|
||||||
--j;
|
--j;
|
||||||
break;
|
break;
|
||||||
|
|
@ -53,9 +160,17 @@ public class EntityChargeEnergy extends EntityCharge {
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
++i;
|
++i;
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,35 +1,142 @@
|
||||||
package mysticworld.entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class EntityChargeFire extends Entity {
|
||||||
|
public EntityPlayer shootingEntity;
|
||||||
|
private boolean inGround = false;
|
||||||
|
private int xTile = -1;
|
||||||
|
private int yTile = -1;
|
||||||
|
private int zTile = -1;
|
||||||
|
private int inTile = 0;
|
||||||
|
private int ticksAlive;
|
||||||
|
private int ticksInAir = 0;
|
||||||
|
|
||||||
public class EntityChargeFire extends EntityCharge {
|
|
||||||
public EntityChargeFire(World par1World) {
|
public EntityChargeFire(World par1World) {
|
||||||
super(par1World);
|
super(par1World);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityChargeFire(World par1World, EntityPlayer par2EntityPlayer) {
|
public EntityChargeFire(World par1World, EntityPlayer par2EntityPlayer) {
|
||||||
super(par1World,par2EntityPlayer);
|
super(par1World);
|
||||||
|
this.setSize(0.25F, 0.25F);
|
||||||
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
|
||||||
|
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.shootingEntity = par2EntityPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chargeFX() {
|
public boolean canBeCollidedWith() {
|
||||||
MysticWorld.proxy.fireFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getBrightness(float par1) {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float par1) {
|
||||||
|
return 15728880;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getCollisionBorderSize() {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getShadowSize() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
|
||||||
|
this.setDead();
|
||||||
|
} else {
|
||||||
|
super.onUpdate();
|
||||||
|
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
||||||
|
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
|
}
|
||||||
|
Entity entity = null;
|
||||||
|
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||||
|
double d0 = 0.0D;
|
||||||
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
|
Entity entity1 = (Entity) list.get(j);
|
||||||
|
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
||||||
|
float f = 0.3F;
|
||||||
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
|
||||||
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
|
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
|
entity = entity1;
|
||||||
|
d0 = d1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (entity != null) {
|
||||||
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
|
}
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
this.onImpact(movingobjectposition);
|
||||||
|
}
|
||||||
|
this.posX += this.motionX;
|
||||||
|
this.posY += this.motionY;
|
||||||
|
this.posZ += this.motionZ;
|
||||||
|
float f2 = this.getMotionFactor();
|
||||||
|
if (this.isInWater()) {
|
||||||
|
for (int k = 0; k < 4; ++k) {
|
||||||
|
float f3 = 0.25F;
|
||||||
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
|
||||||
|
}
|
||||||
|
f2 = 0.8F;
|
||||||
|
}
|
||||||
|
MysticWorld.proxy.fireFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float getMotionFactor() {
|
||||||
|
return 0.95F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
if (!this.worldObj.isRemote) {
|
if (!this.worldObj.isRemote) {
|
||||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||||
if (par1MovingObjectPosition.entityHit != null) {
|
if (par1MovingObjectPosition.entityHit != null) {
|
||||||
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
if (f3 > 0.0F) {
|
if (f3 > 0.0F) {
|
||||||
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 0.6000000238418579D / f3, 0.1D, this.motionZ * 0.6000000238418579D / f3);
|
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
|
||||||
}
|
}
|
||||||
if (!par1MovingObjectPosition.entityHit.isImmuneToFire()) {
|
if (!par1MovingObjectPosition.entityHit.isImmuneToFire()) {
|
||||||
par1MovingObjectPosition.entityHit.setFire(5);
|
par1MovingObjectPosition.entityHit.setFire(5);
|
||||||
|
|
@ -59,10 +166,18 @@ public class EntityChargeFire extends EntityCharge {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
if (this.worldObj.isAirBlock(i, j, k)) {
|
if (this.worldObj.isAirBlock(i, j, k)) {
|
||||||
this.worldObj.setBlock(i, j, k, Blocks.fire);
|
this.worldObj.setBlock(i, j, k, Block.fire.blockID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,141 @@
|
||||||
package mysticworld.entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class EntityChargeWater extends Entity {
|
||||||
|
public EntityPlayer shootingEntity;
|
||||||
|
private boolean inGround = false;
|
||||||
|
private int xTile = -1;
|
||||||
|
private int yTile = -1;
|
||||||
|
private int zTile = -1;
|
||||||
|
private int inTile = 0;
|
||||||
|
private int ticksAlive;
|
||||||
|
private int ticksInAir = 0;
|
||||||
|
|
||||||
public class EntityChargeWater extends EntityCharge {
|
|
||||||
public EntityChargeWater(World par1World) {
|
public EntityChargeWater(World par1World) {
|
||||||
super(par1World);
|
super(par1World);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityChargeWater(World par1World, EntityPlayer par2EntityPlayer) {
|
public EntityChargeWater(World par1World, EntityPlayer par2EntityPlayer) {
|
||||||
super(par1World,par2EntityPlayer);
|
super(par1World);
|
||||||
|
this.setSize(0.25F, 0.25F);
|
||||||
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
|
||||||
|
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||||
|
this.shootingEntity = par2EntityPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chargeFX() {
|
public boolean canBeCollidedWith() {
|
||||||
MysticWorld.proxy.waterFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getBrightness(float par1) {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float par1) {
|
||||||
|
return 15728880;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getCollisionBorderSize() {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public float getShadowSize() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
|
||||||
|
this.setDead();
|
||||||
|
} else {
|
||||||
|
super.onUpdate();
|
||||||
|
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true);
|
||||||
|
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
|
}
|
||||||
|
Entity entity = null;
|
||||||
|
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||||
|
double d0 = 0.0D;
|
||||||
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
|
Entity entity1 = (Entity) list.get(j);
|
||||||
|
if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
||||||
|
float f = 0.3F;
|
||||||
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f);
|
||||||
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
|
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
|
entity = entity1;
|
||||||
|
d0 = d1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (entity != null) {
|
||||||
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
|
}
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
this.onImpact(movingobjectposition);
|
||||||
|
}
|
||||||
|
this.posX += this.motionX;
|
||||||
|
this.posY += this.motionY;
|
||||||
|
this.posZ += this.motionZ;
|
||||||
|
float f2 = this.getMotionFactor();
|
||||||
|
if (this.isInWater()) {
|
||||||
|
for (int k = 0; k < 4; ++k) {
|
||||||
|
float f3 = 0.25F;
|
||||||
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3, this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
|
||||||
|
}
|
||||||
|
f2 = 0.8F;
|
||||||
|
}
|
||||||
|
MysticWorld.proxy.waterFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float getMotionFactor() {
|
||||||
|
return 0.95F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
if (!this.worldObj.isRemote) {
|
if (!this.worldObj.isRemote) {
|
||||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||||
if (par1MovingObjectPosition.entityHit != null) {
|
if (par1MovingObjectPosition.entityHit != null) {
|
||||||
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
if (f3 > 0.0F) {
|
if (f3 > 0.0F) {
|
||||||
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 0.6000000238418579D / f3, 0.1D, this.motionZ * 0.6000000238418579D / f3);
|
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
|
||||||
}
|
}
|
||||||
if (par1MovingObjectPosition.entityHit.isImmuneToFire()) {
|
if (par1MovingObjectPosition.entityHit.isImmuneToFire()) {
|
||||||
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20);
|
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20);
|
||||||
|
|
@ -36,8 +143,8 @@ public class EntityChargeWater extends EntityCharge {
|
||||||
if (par1MovingObjectPosition.entityHit.isBurning()) {
|
if (par1MovingObjectPosition.entityHit.isBurning()) {
|
||||||
par1MovingObjectPosition.entityHit.extinguish();
|
par1MovingObjectPosition.entityHit.extinguish();
|
||||||
}
|
}
|
||||||
}/* else {
|
} else {
|
||||||
/*int i = par1MovingObjectPosition.blockX;
|
int i = par1MovingObjectPosition.blockX;
|
||||||
int j = par1MovingObjectPosition.blockY;
|
int j = par1MovingObjectPosition.blockY;
|
||||||
int k = par1MovingObjectPosition.blockZ;
|
int k = par1MovingObjectPosition.blockZ;
|
||||||
switch (par1MovingObjectPosition.sideHit) {
|
switch (par1MovingObjectPosition.sideHit) {
|
||||||
|
|
@ -59,8 +166,16 @@ public class EntityChargeWater extends EntityCharge {
|
||||||
case 5:
|
case 5:
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,20 @@
|
||||||
package mysticworld.entity;
|
package mysticworld.entity;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
|
import mysticworld.lib.EntityIds;
|
||||||
import mysticworld.lib.Strings;
|
import mysticworld.lib.Strings;
|
||||||
|
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||||
|
|
||||||
public class EntityHandler {
|
public class EntityHandler {
|
||||||
//Entity IDs
|
|
||||||
public static final int ENTITY_AIR_CHARGE = 1;
|
|
||||||
public static final int ENTITY_FIREBALL = 2;
|
|
||||||
public static final int ENTITY_EARTH_CHARGE = 3;
|
|
||||||
public static final int ENTITY_ENERGY_CHARGE = 4;
|
|
||||||
public static final int ENTITY_WATER_CHARGE = 5;
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
EntityRegistry.registerModEntity(EntityChargeAir.class, Strings.ENTITY_AIR_CHARGE_NAME, ENTITY_AIR_CHARGE, MysticWorld.instance, 80, 3, false);
|
registerEntities();
|
||||||
EntityRegistry.registerModEntity(EntityChargeFire.class, Strings.ENTITY_FIREBALL_NAME, ENTITY_FIREBALL, MysticWorld.instance, 80, 3, false);
|
}
|
||||||
EntityRegistry.registerModEntity(EntityChargeEarth.class, Strings.ENTITY_EARTH_CHARGE_NAME, ENTITY_EARTH_CHARGE, MysticWorld.instance, 80, 3, false);
|
|
||||||
EntityRegistry.registerModEntity(EntityChargeEnergy.class, Strings.ENTITY_ENERGY_CHARGE_NAME, ENTITY_ENERGY_CHARGE, MysticWorld.instance, 80, 3, false);
|
public static void registerEntities() {
|
||||||
EntityRegistry.registerModEntity(EntityChargeWater.class, Strings.ENTITY_WATER_CHARGE_NAME, ENTITY_WATER_CHARGE, MysticWorld.instance, 80, 3, false);
|
EntityRegistry.registerModEntity(EntityChargeAir.class, Strings.ENTITY_AIR_CHARGE_NAME, EntityIds.ENTITY_AIR_CHARGE, MysticWorld.instance, 80, 3, false);
|
||||||
|
EntityRegistry.registerModEntity(EntityChargeFire.class, Strings.ENTITY_FIREBALL_NAME, EntityIds.ENTITY_FIREBALL, MysticWorld.instance, 80, 3, false);
|
||||||
|
EntityRegistry.registerModEntity(EntityChargeEarth.class, Strings.ENTITY_EARTH_CHARGE_NAME, EntityIds.ENTITY_EARTH_CHARGE, MysticWorld.instance, 80, 3, false);
|
||||||
|
EntityRegistry.registerModEntity(EntityChargeEnergy.class, Strings.ENTITY_ENERGY_CHARGE_NAME, EntityIds.ENTITY_ENERGY_CHARGE, MysticWorld.instance, 80, 3, false);
|
||||||
|
EntityRegistry.registerModEntity(EntityChargeWater.class, Strings.ENTITY_WATER_CHARGE_NAME, EntityIds.ENTITY_WATER_CHARGE, MysticWorld.instance, 80, 3, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package mysticworld.items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.EnumArmorMaterial;
|
||||||
import net.minecraftforge.common.util.EnumHelper;
|
import net.minecraftforge.common.EnumHelper;
|
||||||
|
|
||||||
public class EnumArmor
|
public class EnumArmor
|
||||||
{
|
{
|
||||||
public static final ItemArmor.ArmorMaterial Verdite = EnumHelper.addArmorMaterial("Verdite", 262, new int[]{2, 5, 4, 1}, 5);
|
static EnumArmorMaterial Verdite = EnumHelper.addArmorMaterial("Verdite", 262, new int[]{2, 5, 4, 1}, 5);
|
||||||
public static final ItemArmor.ArmorMaterial Mithril = EnumHelper.addArmorMaterial("Mithril", 500, new int[]{2, 7, 6, 2}, 9);
|
static EnumArmorMaterial Mithril = EnumHelper.addArmorMaterial("Mithril", 500, new int[]{2, 7, 6, 2}, 9);
|
||||||
public static final ItemArmor.ArmorMaterial Adamantine = EnumHelper.addArmorMaterial("Adamantine", 3000, new int[]{4, 9, 6, 4}, 13);
|
static EnumArmorMaterial Adamantine = EnumHelper.addArmorMaterial("Adamantine", 3000, new int[]{4, 9, 6, 4}, 13);
|
||||||
public static final ItemArmor.ArmorMaterial Iridium = EnumHelper.addArmorMaterial("Iridium", 4000, new int[]{4, 10, 7, 5}, 15);
|
static EnumArmorMaterial Iridium = EnumHelper.addArmorMaterial("Iridium", 4000, new int[]{4, 10, 7, 5}, 15);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
47
common/MysticWorld/Items/ItemArmorAdamantine.java
Normal file
47
common/MysticWorld/Items/ItemArmorAdamantine.java
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
package mysticworld.items;
|
||||||
|
|
||||||
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.item.EnumArmorMaterial;
|
||||||
|
import net.minecraft.item.ItemArmor;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ItemArmorAdamantine extends ItemArmor {
|
||||||
|
int ArmorType;
|
||||||
|
String ArmorFile_1;
|
||||||
|
String ArmorFile_2;
|
||||||
|
|
||||||
|
public ItemArmorAdamantine(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||||
|
super(par1, par2EnumArmorMaterial, par3, par4);
|
||||||
|
this.ArmorType = par4;
|
||||||
|
this.setMaxDamage(3000);
|
||||||
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
|
this.ArmorFile_1 = "/MysticMods/textures/armor/adamantine_1.png";
|
||||||
|
this.ArmorFile_2 = "/MysticMods/textures/armor/adamantine_2.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||||
|
int suffix = this.armorType == 2 ? 2 : 1;
|
||||||
|
return "MysticMods:textures" + "/models/armor/Adamantine_layer_" + suffix + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
switch (ArmorType) {
|
||||||
|
case 0:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_0");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_1");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_2");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:AdamantineArmor_3");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,45 +1,82 @@
|
||||||
package mysticworld.items;
|
package mysticworld.items;
|
||||||
|
|
||||||
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumArmorMaterial;
|
||||||
|
import net.minecraft.item.ItemArmor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemArmorIridium extends ItemMaterialArmor {
|
public class ItemArmorIridium extends ItemArmor {
|
||||||
public ItemArmorIridium(ArmorMaterial par2EnumArmorMaterial, int par4) {
|
int ArmorType;
|
||||||
super(par2EnumArmorMaterial, par4);
|
String ArmorFile_1;
|
||||||
|
String ArmorFile_2;
|
||||||
|
|
||||||
|
public ItemArmorIridium(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||||
|
super(par1, par2EnumArmorMaterial, par3, par4);
|
||||||
|
this.ArmorType = par4;
|
||||||
this.setMaxDamage(4000);
|
this.setMaxDamage(4000);
|
||||||
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
|
this.ArmorFile_1 = "/assets/MysticMods/textures/armor/iridium_1.png";
|
||||||
|
this.ArmorFile_2 = "/assets/MysticMods/textures/armor/iridium_2.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||||
ItemStack helmet = player.getEquipmentInSlot(4);
|
int suffix = this.armorType == 2 ? 2 : 1;
|
||||||
|
return "MysticMods:textures" + "/models/armor/Iridium_layer_" + suffix + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) {
|
||||||
|
ItemStack helmet = player.getCurrentItemOrArmor(4);
|
||||||
|
ItemStack plate = player.getCurrentItemOrArmor(3);
|
||||||
|
ItemStack legs = player.getCurrentItemOrArmor(2);
|
||||||
|
ItemStack boots = player.getCurrentItemOrArmor(1);
|
||||||
if (helmet != null) {
|
if (helmet != null) {
|
||||||
if (helmet.getItem() == ItemHandler.iridiumHelmet) {
|
if (helmet.itemID == ItemHandler.iridiumHelmet.itemID) {
|
||||||
player.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 210, 0)));
|
player.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 200, 0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ItemStack plate = player.getEquipmentInSlot(3);
|
|
||||||
if (plate != null) {
|
if (plate != null) {
|
||||||
if (plate.getItem() == ItemHandler.iridiumChestplate) {
|
if (plate.itemID == ItemHandler.iridiumChestplate.itemID) {
|
||||||
player.addPotionEffect((new PotionEffect(Potion.regeneration.getId(), 200, 0)));
|
player.addPotionEffect((new PotionEffect(Potion.regeneration.getId(), 200, 0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ItemStack legs = player.getEquipmentInSlot(2);
|
|
||||||
if (legs != null) {
|
if (legs != null) {
|
||||||
if (legs.getItem() == ItemHandler.iridiumLeggings) {
|
if (legs.itemID == ItemHandler.iridiumLeggings.itemID) {
|
||||||
player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 200, 2)));
|
player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 200, 2)));
|
||||||
player.addVelocity(0.0005, 0, 0.0005);
|
player.addVelocity(0.0005, 0, 0.0005);
|
||||||
player.stepHeight = 1.001F;
|
player.stepHeight = 1.001F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ItemStack boots = player.getEquipmentInSlot(1);
|
|
||||||
if (boots != null) {
|
if (boots != null) {
|
||||||
if (boots.getItem() == ItemHandler.iridiumBoots) {
|
if (boots.itemID == ItemHandler.iridiumBoots.itemID) {
|
||||||
player.fallDistance = 0.0F;
|
player.fallDistance = 0.0F;
|
||||||
player.addPotionEffect((new PotionEffect(Potion.jump.getId(), 200, 2)));
|
player.addPotionEffect((new PotionEffect(Potion.jump.getId(), 200, 2)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
switch (ArmorType) {
|
||||||
|
case 0:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_0");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_1");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_2");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:IridiumArmor_3");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
47
common/MysticWorld/Items/ItemArmorMithril.java
Normal file
47
common/MysticWorld/Items/ItemArmorMithril.java
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
package mysticworld.items;
|
||||||
|
|
||||||
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.item.EnumArmorMaterial;
|
||||||
|
import net.minecraft.item.ItemArmor;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ItemArmorMithril extends ItemArmor {
|
||||||
|
int ArmorType;
|
||||||
|
String ArmorFile_1;
|
||||||
|
String ArmorFile_2;
|
||||||
|
|
||||||
|
public ItemArmorMithril(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||||
|
super(par1, par2EnumArmorMaterial, par3, par4);
|
||||||
|
this.ArmorType = par4;
|
||||||
|
this.setMaxDamage(500);
|
||||||
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
|
this.ArmorFile_1 = "/assets/MysticMods/textures/armor/mithril_1.png";
|
||||||
|
this.ArmorFile_2 = "/assets/MysticMods/textures/armor/mithril_2.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||||
|
int suffix = this.armorType == 2 ? 2 : 1;
|
||||||
|
return "MysticMods:textures" + "/models/armor/Mithril_layer_" + suffix + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
switch (ArmorType) {
|
||||||
|
case 0:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_0");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_1");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_2");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:MithrilArmor_3");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
47
common/MysticWorld/Items/ItemArmorVerdite.java
Normal file
47
common/MysticWorld/Items/ItemArmorVerdite.java
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
package mysticworld.items;
|
||||||
|
|
||||||
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.item.EnumArmorMaterial;
|
||||||
|
import net.minecraft.item.ItemArmor;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ItemArmorVerdite extends ItemArmor {
|
||||||
|
int ArmorType;
|
||||||
|
String ArmorFile_1;
|
||||||
|
String ArmorFile_2;
|
||||||
|
|
||||||
|
public ItemArmorVerdite(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||||
|
super(par1, par2EnumArmorMaterial, par3, par4);
|
||||||
|
this.ArmorType = par4;
|
||||||
|
this.setMaxDamage(262);
|
||||||
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
|
this.ArmorFile_1 = "/assets/MysticMods/textures/armor/verdite_1.png";
|
||||||
|
this.ArmorFile_2 = "/assets/MysticMods/textures/armor/verdite_2.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||||
|
int suffix = this.armorType == 2 ? 2 : 1;
|
||||||
|
return "MysticMods:textures" + "/models/armor/Verdite_layer_" + suffix + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
switch (ArmorType) {
|
||||||
|
case 0:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_0");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_1");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_2");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:VerditeArmor_3");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,38 +1,38 @@
|
||||||
package mysticworld.items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import java.util.List;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemFood;
|
import net.minecraft.item.ItemFood;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.Icon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import java.util.List;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemBushFruit extends ItemFood {
|
public class ItemBushFruit extends ItemFood {
|
||||||
private IIcon[] icons;
|
private Icon[] icons;
|
||||||
private static final String[] FRUIT_TYPES = new String[] { "Mundane", "Poison", "Weakness", "Slowness", "Harming", "Wither", "Health", "Speed", "FireResistance", "Regen", "NightVision",
|
private static final String[] FRUIT_TYPES = new String[] { "Mundane", "Poison", "Weakness", "Slowness", "Harming", "Wither", "Health", "Speed", "FireResistance", "Regen", "NightVision",
|
||||||
"Invisibility" };
|
"Invisibility" };
|
||||||
|
|
||||||
public ItemBushFruit(int health) {
|
public ItemBushFruit(int id, int health) {
|
||||||
super(health, 0.6F, false);
|
super(id, health, 0.6F, false);
|
||||||
this.setHasSubtypes(true);
|
this.setHasSubtypes(true);
|
||||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
maxStackSize = 64;
|
maxStackSize = 64;
|
||||||
setAlwaysEdible();
|
setAlwaysEdible();
|
||||||
|
setUnlocalizedName("bushFruit");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIconFromDamage(int meta) {
|
public Icon getIconFromDamage(int meta) {
|
||||||
int j = MathHelper.clamp_int(meta, 0, FRUIT_TYPES.length);
|
int j = MathHelper.clamp_int(meta, 0, FRUIT_TYPES.length);
|
||||||
return icons[j];
|
return icons[j];
|
||||||
}
|
}
|
||||||
|
|
@ -44,7 +44,7 @@ public class ItemBushFruit extends ItemFood {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||||
for (int var4 = 0; var4 < FRUIT_TYPES.length; var4++) {
|
for (int var4 = 0; var4 < FRUIT_TYPES.length; var4++) {
|
||||||
par3List.add(new ItemStack(par1, 1, var4));
|
par3List.add(new ItemStack(par1, 1, var4));
|
||||||
}
|
}
|
||||||
|
|
@ -60,10 +60,10 @@ public class ItemBushFruit extends ItemFood {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
icons = new IIcon[FRUIT_TYPES.length];
|
icons = new Icon[FRUIT_TYPES.length];
|
||||||
for (int i = 0; i < FRUIT_TYPES.length; ++i) {
|
for (int i = 0; i < FRUIT_TYPES.length; ++i) {
|
||||||
icons[i] = iconRegister.registerIcon("mysticworld:Fruit" + FRUIT_TYPES[i]);
|
icons[i] = iconRegister.registerIcon("MysticMods:Fruit" + FRUIT_TYPES[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -76,77 +76,77 @@ public class ItemBushFruit extends ItemFood {
|
||||||
case 1:
|
case 1:
|
||||||
potion = player.getActivePotionEffect(Potion.poison);
|
potion = player.getActivePotionEffect(Potion.poison);
|
||||||
if (potion != null) {
|
if (potion != null) {
|
||||||
duration = potion.getDuration();
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
potion = player.getActivePotionEffect(Potion.weakness);
|
potion = player.getActivePotionEffect(Potion.weakness);
|
||||||
if (potion != null) {
|
if (potion != null) {
|
||||||
duration = potion.getDuration();
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.weakness.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.weakness.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
potion = player.getActivePotionEffect(Potion.moveSlowdown);
|
potion = player.getActivePotionEffect(Potion.moveSlowdown);
|
||||||
if (potion != null) {
|
if (potion != null) {
|
||||||
duration = potion.getDuration();
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
potion = player.getActivePotionEffect(Potion.harm);
|
potion = player.getActivePotionEffect(Potion.harm);
|
||||||
if (potion != null) {
|
if (potion != null) {
|
||||||
duration = potion.getDuration();
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.harm.id, duration + 1, 0));
|
player.addPotionEffect(new PotionEffect(Potion.harm.id, duration + 1, 0));
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
potion = player.getActivePotionEffect(Potion.wither);
|
potion = player.getActivePotionEffect(Potion.wither);
|
||||||
if (potion != null) {
|
if (potion != null) {
|
||||||
duration = potion.getDuration();
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.wither.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.wither.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
potion = player.getActivePotionEffect(Potion.heal);
|
potion = player.getActivePotionEffect(Potion.heal);
|
||||||
if (potion != null) {
|
if (potion != null) {
|
||||||
duration = potion.getDuration();
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.heal.id, duration + 1, 0));
|
player.addPotionEffect(new PotionEffect(Potion.heal.id, duration + 1, 0));
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
potion = player.getActivePotionEffect(Potion.moveSpeed);
|
potion = player.getActivePotionEffect(Potion.moveSpeed);
|
||||||
if (potion != null) {
|
if (potion != null) {
|
||||||
duration = potion.getDuration();
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
potion = player.getActivePotionEffect(Potion.fireResistance);
|
potion = player.getActivePotionEffect(Potion.fireResistance);
|
||||||
if (potion != null) {
|
if (potion != null) {
|
||||||
duration = potion.getDuration();
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
potion = player.getActivePotionEffect(Potion.regeneration);
|
potion = player.getActivePotionEffect(Potion.regeneration);
|
||||||
if (potion != null) {
|
if (potion != null) {
|
||||||
duration = potion.getDuration();
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
potion = player.getActivePotionEffect(Potion.nightVision);
|
potion = player.getActivePotionEffect(Potion.nightVision);
|
||||||
if (potion != null) {
|
if (potion != null) {
|
||||||
duration = potion.getDuration();
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
potion = player.getActivePotionEffect(Potion.invisibility);
|
potion = player.getActivePotionEffect(Potion.invisibility);
|
||||||
if (potion != null) {
|
if (potion != null) {
|
||||||
duration = potion.getDuration();
|
duration = potion.duration;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(new PotionEffect(Potion.invisibility.id, duration + 160, 0));
|
player.addPotionEffect(new PotionEffect(Potion.invisibility.id, duration + 160, 0));
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,39 @@
|
||||||
package mysticworld.items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticworld.MysticWorld;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import mysticworld.MysticWorld;
|
||||||
|
import mysticworld.lib.Strings;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Icon;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemImbuedShard extends Item {
|
public class ItemImbuedShard extends Item {
|
||||||
private IIcon[] icons;
|
private Icon[] icons;
|
||||||
private static final String[] SHARD_TYPES = new String[] { "Fire", "Water", "Earth", "Air", "Energy" };
|
private static final String[] SHARD_TYPES = new String[] { "Fire", "Water", "Earth", "Air", "Energy" };
|
||||||
|
|
||||||
public ItemImbuedShard() {
|
public ItemImbuedShard(int id) {
|
||||||
super();
|
super(id);
|
||||||
this.setHasSubtypes(true);
|
this.setHasSubtypes(true);
|
||||||
|
this.setUnlocalizedName(Strings.IMBUED_SHARD_NAME);
|
||||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIconFromDamage(int meta) {
|
public Icon getIconFromDamage(int meta) {
|
||||||
int j = MathHelper.clamp_int(meta, 0, 5);
|
int j = MathHelper.clamp_int(meta, 0, 5);
|
||||||
return icons[j];
|
return icons[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||||
for (int var4 = 0; var4 < SHARD_TYPES.length; var4++) {
|
for (int var4 = 0; var4 < SHARD_TYPES.length; var4++) {
|
||||||
par3List.add(new ItemStack(par1, 1, var4));
|
par3List.add(new ItemStack(par1, 1, var4));
|
||||||
}
|
}
|
||||||
|
|
@ -45,10 +47,10 @@ public class ItemImbuedShard extends Item {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
icons = new IIcon[SHARD_TYPES.length];
|
icons = new Icon[SHARD_TYPES.length];
|
||||||
for (int i = 0; i < SHARD_TYPES.length; ++i) {
|
for (int i = 0; i < SHARD_TYPES.length; ++i) {
|
||||||
icons[i] = iconRegister.registerIcon("mysticworld:Shard" + SHARD_TYPES[i]);
|
icons[i] = iconRegister.registerIcon("MysticMods:Shard" + SHARD_TYPES[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,17 @@
|
||||||
package mysticworld.items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import java.util.Random;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
public class ItemOrb extends Item {
|
public class ItemOrb extends Item {
|
||||||
public ItemOrb() {
|
Random rand = new Random();
|
||||||
super();
|
|
||||||
|
public ItemOrb(int id) {
|
||||||
|
super(id);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
this.setMaxDamage(200);
|
this.setMaxDamage(200);
|
||||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerIcons(IIconRegister par1IconRegister) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,86 +5,95 @@ import net.minecraft.entity.Entity;
|
||||||
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.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.potion.Potion;
|
|
||||||
import net.minecraft.potion.PotionEffect;
|
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import org.lwjgl.input.Mouse;
|
||||||
|
|
||||||
public class ItemOrbAir extends ItemOrb {
|
public class ItemOrbAir extends ItemOrb {
|
||||||
public ItemOrbAir() {
|
public ItemOrbAir(int id) {
|
||||||
super();
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
|
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
|
||||||
player.setItemInUse(itemStack, this.getMaxItemUseDuration(itemStack));
|
if (itemStack.stackTagCompound == null)
|
||||||
return itemStack;
|
itemStack.setTagCompound(new NBTTagCompound());
|
||||||
|
if (itemStack.stackTagCompound.getBoolean("charging") == false) {
|
||||||
|
itemStack.stackTagCompound.setBoolean("charging", true);
|
||||||
|
}
|
||||||
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxItemUseDuration(ItemStack itemStack){
|
|
||||||
return 5*20;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlayerStoppedUsing(ItemStack itemStack, World world, EntityPlayer player, int time) {
|
|
||||||
int charge = getMaxItemUseDuration(itemStack)-time;
|
|
||||||
if (charge > 0) {
|
|
||||||
if (player.onGround) {
|
|
||||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
|
||||||
if(!world.isRemote){
|
|
||||||
player.addPotionEffect(new PotionEffect(Potion.jump.getId(), 50, charge*25/getMaxItemUseDuration(itemStack)));
|
|
||||||
}
|
|
||||||
itemStack.damageItem(1, player);
|
|
||||||
}
|
|
||||||
resetData(itemStack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||||
if (par5) {
|
if (itemStack.stackTagCompound == null)
|
||||||
entity.fallDistance = 0.0F;
|
itemStack.setTagCompound(new NBTTagCompound());
|
||||||
chargeEffect(itemStack, world, entity);
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
}
|
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||||
|
itemStack.stackTagCompound.setInteger("maxChargeTime", 5 * 20);
|
||||||
|
if (currentItem != null) {
|
||||||
|
if (currentItem.itemID == itemStack.itemID) {
|
||||||
|
player.fallDistance = 0.0F;
|
||||||
|
chargeEffect(itemStack, world, player);
|
||||||
|
if (!Mouse.isButtonDown(1)) {
|
||||||
|
if (itemStack.stackTagCompound.getInteger("chargeTime") > 0) {
|
||||||
|
if (player.onGround) {
|
||||||
|
world.playSoundEffect(player.posX, player.posY, player.posZ, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||||
|
player.setVelocity(0.0D, 1.0D + (itemStack.stackTagCompound.getInteger("chargeTime")) * (2.5D * (1.0D / itemStack.stackTagCompound.getInteger("maxChargeTime"))), 0.0D);
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resetData(itemStack);
|
||||||
|
} else {
|
||||||
|
if (itemStack.stackTagCompound.getBoolean("charging") == true) {
|
||||||
|
incrementData(itemStack);
|
||||||
|
}
|
||||||
|
spiralEffect(itemStack, world, player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetData(itemStack);
|
||||||
|
itemStack.stackTagCompound.setFloat("angle", 0);
|
||||||
|
itemStack.stackTagCompound.setDouble("radius", 0);
|
||||||
|
}
|
||||||
|
if (itemStack.stackTagCompound.getInteger("chargeTime") > itemStack.stackTagCompound.getInteger("maxChargeTime")) {
|
||||||
|
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("maxChargeTime"));
|
||||||
|
}
|
||||||
|
if (itemStack.stackTagCompound.getDouble("radius") > 2.5D) {
|
||||||
|
itemStack.stackTagCompound.setDouble("radius", 2.5D);
|
||||||
|
}
|
||||||
|
if (itemStack.stackTagCompound.getFloat("angle") > 6.0f) {
|
||||||
|
itemStack.stackTagCompound.setFloat("angle", 0.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private void chargeEffect(ItemStack itemStack, World world, EntityPlayer player) {
|
||||||
public void onUsingTick(ItemStack stack, EntityPlayer player, int count){
|
double particleX = (player.posX - 0.5D) + rand.nextDouble();
|
||||||
if (stack.stackTagCompound == null){
|
double particleZ = (player.posZ - 0.5D) + rand.nextDouble();
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
if (!world.isRemote)
|
||||||
}
|
MysticWorld.proxy.airFeetFX(world, particleX, player.posY, particleZ, 1.0f, 15);
|
||||||
incrementData(stack, getMaxItemUseDuration(stack) - count);
|
|
||||||
spiralEffect(stack, player.worldObj, player, getMaxItemUseDuration(stack) - count);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void chargeEffect(ItemStack itemStack, World world, Entity player) {
|
|
||||||
double particleX = (player.posX - 0.5D) + itemRand.nextDouble();
|
|
||||||
double particleZ = (player.posZ - 0.5D) + itemRand.nextDouble();
|
|
||||||
MysticWorld.proxy.airFeetFX(world, particleX, player.posY, particleZ, 1.0f, 15);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void incrementData(ItemStack itemStack, int charge) {
|
private void incrementData(ItemStack itemStack) {
|
||||||
|
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1);
|
||||||
itemStack.stackTagCompound.setFloat("angle", itemStack.stackTagCompound.getFloat("angle") + 0.2f);
|
itemStack.stackTagCompound.setFloat("angle", itemStack.stackTagCompound.getFloat("angle") + 0.2f);
|
||||||
itemStack.stackTagCompound.setDouble("radius", charge * 0.025D);
|
itemStack.stackTagCompound.setDouble("radius", itemStack.stackTagCompound.getInteger("chargeTime") * 0.025D);
|
||||||
if (itemStack.stackTagCompound.getDouble("radius") > 2.5D) {
|
|
||||||
itemStack.stackTagCompound.setDouble("radius", 2.5D);
|
|
||||||
}
|
|
||||||
if (itemStack.stackTagCompound.getFloat("angle") > 6.0f) {
|
|
||||||
itemStack.stackTagCompound.setFloat("angle", 0.0f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetData(ItemStack itemStack) {
|
private void resetData(ItemStack itemStack) {
|
||||||
|
itemStack.stackTagCompound.setInteger("chargeTime", 0);
|
||||||
|
itemStack.stackTagCompound.setBoolean("charging", false);
|
||||||
itemStack.stackTagCompound.setFloat("angle", 0);
|
itemStack.stackTagCompound.setFloat("angle", 0);
|
||||||
itemStack.stackTagCompound.setDouble("radius", 0);
|
itemStack.stackTagCompound.setDouble("radius", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void spiralEffect(ItemStack itemStack, World world, EntityPlayer player, int charge) {
|
private void spiralEffect(ItemStack itemStack, World world, EntityPlayer player) {
|
||||||
double particleX = player.posX + (MathHelper.cos(itemStack.stackTagCompound.getFloat("angle"))) * itemStack.stackTagCompound.getDouble("radius");
|
double particleX = player.posX + (MathHelper.cos(itemStack.stackTagCompound.getFloat("angle"))) * itemStack.stackTagCompound.getDouble("radius");
|
||||||
double particleY = player.posY;
|
double particleY = player.posY;
|
||||||
double particleZ = player.posZ + (MathHelper.sin(itemStack.stackTagCompound.getFloat("angle"))) * itemStack.stackTagCompound.getDouble("radius");
|
double particleZ = player.posZ + (MathHelper.sin(itemStack.stackTagCompound.getFloat("angle"))) * itemStack.stackTagCompound.getDouble("radius");
|
||||||
float particleScale = charge * 5.0f / getMaxItemUseDuration(itemStack);
|
float particleScale = ((itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float) itemStack.stackTagCompound.getInteger("maxChargeTime"))));
|
||||||
MysticWorld.proxy.airFeetFX(world, particleX, particleY, particleZ, 1.0f + particleScale, 15);
|
if (!world.isRemote)
|
||||||
|
MysticWorld.proxy.airFeetFX(world, particleX, particleY, particleZ, 1.0f + particleScale, 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,26 @@
|
||||||
package mysticworld.items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import cpw.mods.fml.common.eventhandler.Event;
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.IGrowable;
|
import net.minecraft.block.BlockCocoa;
|
||||||
|
import net.minecraft.block.BlockCrops;
|
||||||
|
import net.minecraft.block.BlockDirectional;
|
||||||
|
import net.minecraft.block.BlockMushroom;
|
||||||
|
import net.minecraft.block.BlockSapling;
|
||||||
|
import net.minecraft.block.BlockStem;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
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.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.event.Event.Result;
|
||||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||||
|
|
||||||
public class ItemOrbEarth extends ItemOrb {
|
public class ItemOrbEarth extends ItemOrb {
|
||||||
public ItemOrbEarth() {
|
public ItemOrbEarth(int id) {
|
||||||
super();
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -34,35 +41,124 @@ public class ItemOrbEarth extends ItemOrb {
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||||
EntityPlayer player = (EntityPlayer) entity;
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
if (par5) {
|
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||||
MysticWorld.proxy.earthFX(world, (player.posX - 0.5D) + itemRand.nextDouble(), player.posY, (player.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
if (!world.isRemote) {
|
||||||
|
if (currentItem != null) {
|
||||||
|
if (currentItem.itemID == itemStack.itemID) {
|
||||||
|
MysticWorld.proxy.earthFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean applyBonemeal(ItemStack itemStack, World world, int x, int y, int z, EntityPlayer player) {
|
public static boolean applyBonemeal(ItemStack itemStack, World par1World, int par2, int par3, int par4, EntityPlayer player) {
|
||||||
Block block = world.getBlock(x, y, z);
|
int l = par1World.getBlockId(par2, par3, par4);
|
||||||
BonemealEvent event = new BonemealEvent(player, world, block, x, y, z);
|
BonemealEvent event = new BonemealEvent(player, par1World, l, par2, par3, par4);
|
||||||
if (MinecraftForge.EVENT_BUS.post(event)){
|
if (MinecraftForge.EVENT_BUS.post(event)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (event.getResult() == Event.Result.ALLOW){
|
if (event.getResult() == Result.ALLOW) {
|
||||||
if (!world.isRemote){
|
itemStack.damageItem(1, player);
|
||||||
itemStack.damageItem(1, player);
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
if (l == Block.sapling.blockID) {
|
||||||
}
|
if (!par1World.isRemote) {
|
||||||
if (block instanceof IGrowable){
|
if (par1World.rand.nextFloat() < 0.45D) {
|
||||||
IGrowable igrowable = (IGrowable)block;
|
((BlockSapling) Block.sapling).markOrGrowMarked(par1World, par2, par3, par4, par1World.rand);
|
||||||
if (igrowable.func_149851_a(world, x, y, z, world.isRemote)){
|
}
|
||||||
if (!world.isRemote){
|
itemStack.damageItem(1, player);
|
||||||
if (igrowable.func_149852_a(world, world.rand, x, y, z)){
|
}
|
||||||
igrowable.func_149853_b(world, world.rand, x, y, z);
|
return true;
|
||||||
}
|
} else if (l == Block.cobblestone.blockID) {
|
||||||
itemStack.damageItem(1, player);
|
if (!par1World.isRemote) {
|
||||||
}
|
par1World.setBlock(par2, par3, par4, Block.cobblestoneMossy.blockID);
|
||||||
return true;
|
}
|
||||||
}
|
itemStack.damageItem(1, player);
|
||||||
}
|
} else if (l == Block.deadBush.blockID) {
|
||||||
return false;
|
if (!par1World.isRemote) {
|
||||||
|
par1World.setBlock(par2, par3, par4, 0);
|
||||||
|
par1World.spawnEntityInWorld(new EntityItem(par1World, par2, par3, par4, new ItemStack(Block.sapling, 1)));
|
||||||
|
}
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
} else if (l != Block.mushroomBrown.blockID && l != Block.mushroomRed.blockID) {
|
||||||
|
if (l != Block.melonStem.blockID && l != Block.pumpkinStem.blockID) {
|
||||||
|
if (l > 0 && Block.blocksList[l] instanceof BlockCrops) {
|
||||||
|
if (par1World.getBlockMetadata(par2, par3, par4) == 7) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
((BlockCrops) Block.blocksList[l]).fertilize(par1World, par2, par3, par4);
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int i1;
|
||||||
|
int j1;
|
||||||
|
int k1;
|
||||||
|
if (l == Block.cocoaPlant.blockID) {
|
||||||
|
i1 = par1World.getBlockMetadata(par2, par3, par4);
|
||||||
|
j1 = BlockDirectional.getDirection(i1);
|
||||||
|
k1 = BlockCocoa.func_72219_c(i1);
|
||||||
|
if (k1 >= 2) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
++k1;
|
||||||
|
par1World.setBlockMetadataWithNotify(par2, par3, par4, k1 << 2 | j1, 2);
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if (l != Block.grass.blockID) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
label102: for (i1 = 0; i1 < 128; ++i1) {
|
||||||
|
j1 = par2;
|
||||||
|
k1 = par3 + 1;
|
||||||
|
int l1 = par4;
|
||||||
|
for (int i2 = 0; i2 < i1 / 16; ++i2) {
|
||||||
|
j1 += itemRand.nextInt(3) - 1;
|
||||||
|
k1 += (itemRand.nextInt(3) - 1) * itemRand.nextInt(3) / 2;
|
||||||
|
l1 += itemRand.nextInt(3) - 1;
|
||||||
|
if (par1World.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || par1World.isBlockNormalCube(j1, k1, l1)) {
|
||||||
|
continue label102;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (par1World.getBlockId(j1, k1, l1) == 0) {
|
||||||
|
if (itemRand.nextInt(10) != 0) {
|
||||||
|
if (Block.tallGrass.canBlockStay(par1World, j1, k1, l1)) {
|
||||||
|
par1World.setBlock(j1, k1, l1, Block.tallGrass.blockID, 1, 3);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ForgeHooks.plantGrass(par1World, j1, k1, l1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (par1World.getBlockMetadata(par2, par3, par4) == 7) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
((BlockStem) Block.blocksList[l]).fertilizeStem(par1World, par2, par3, par4);
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
if (par1World.rand.nextFloat() < 0.4D) {
|
||||||
|
((BlockMushroom) Block.blocksList[l]).fertilizeMushroom(par1World, par2, par3, par4, par1World.rand);
|
||||||
|
}
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,16 @@ package mysticworld.items;
|
||||||
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import mysticworld.blocks.BlockHandler;
|
import mysticworld.blocks.BlockHandler;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemOrbEnergy extends ItemOrb {
|
public class ItemOrbEnergy extends ItemOrb {
|
||||||
public ItemOrbEnergy() {
|
public ItemOrbEnergy(int id) {
|
||||||
super();
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -39,10 +37,10 @@ public class ItemOrbEnergy extends ItemOrb {
|
||||||
if (!entityPlayer.canPlayerEdit(par4, par5, par6, par7, itemStack)) {
|
if (!entityPlayer.canPlayerEdit(par4, par5, par6, par7, itemStack)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
Block i1 = world.getBlock(par4, par5, par6);
|
int i1 = world.getBlockId(par4, par5, par6);
|
||||||
if (i1 == Blocks.air) {
|
if (i1 == 0) {
|
||||||
world.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
world.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||||
world.setBlock(par4, par5, par6, BlockHandler.lightCube);
|
world.setBlock(par4, par5, par6, BlockHandler.lightCube.blockID);
|
||||||
}
|
}
|
||||||
itemStack.damageItem(1, entityPlayer);
|
itemStack.damageItem(1, entityPlayer);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -51,9 +49,15 @@ public class ItemOrbEnergy extends ItemOrb {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||||
if (entity instanceof EntityPlayer && par5) {
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
((EntityPlayer)entity).addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2));
|
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||||
MysticWorld.proxy.energyFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
if (!world.isRemote) {
|
||||||
|
if (currentItem != null) {
|
||||||
|
if (currentItem.itemID == itemStack.itemID) {
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2));
|
||||||
|
MysticWorld.proxy.energyFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package mysticworld.items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
|
@ -12,15 +12,14 @@ import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemOrbFire extends ItemOrb {
|
public class ItemOrbFire extends ItemOrb {
|
||||||
public ItemOrbFire() {
|
public ItemOrbFire(int id) {
|
||||||
super();
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving) {
|
||||||
public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityPlayer, EntityLivingBase entity) {
|
entityLiving.setFire(5);
|
||||||
entity.setFire(5);
|
entityLiving.attackEntityFrom(DamageSource.magic, 7);
|
||||||
entity.attackEntityFrom(DamageSource.magic, 7);
|
itemStack.damageItem(1, entityLiving);
|
||||||
itemStack.damageItem(1, entityPlayer);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,7 +48,7 @@ public class ItemOrbFire extends ItemOrb {
|
||||||
} else {
|
} else {
|
||||||
if (par3World.isAirBlock(par4, par5, par6)) {
|
if (par3World.isAirBlock(par4, par5, par6)) {
|
||||||
par3World.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
par3World.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||||
par3World.setBlock(par4, par5, par6, Blocks.fire);
|
par3World.setBlock(par4, par5, par6, Block.fire.blockID);
|
||||||
}
|
}
|
||||||
par1ItemStack.damageItem(1, par2EntityPlayer);
|
par1ItemStack.damageItem(1, par2EntityPlayer);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -66,9 +65,15 @@ public class ItemOrbFire extends ItemOrb {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||||
if (entity instanceof EntityPlayer && par5) {
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
((EntityPlayer)entity).addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0));
|
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||||
MysticWorld.proxy.fireFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
if (!world.isRemote) {
|
||||||
|
if (currentItem != null) {
|
||||||
|
if (currentItem.itemID == itemStack.itemID) {
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0));
|
||||||
|
MysticWorld.proxy.fireFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,14 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumMovingObjectType;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemOrbWater extends ItemOrb {
|
public class ItemOrbWater extends ItemOrb {
|
||||||
public ItemOrbWater() {
|
public ItemOrbWater(int id) {
|
||||||
super();
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -21,7 +21,7 @@ public class ItemOrbWater extends ItemOrb {
|
||||||
if (movingobjectposition == null) {
|
if (movingobjectposition == null) {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
} else {
|
} else {
|
||||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
|
||||||
int i = movingobjectposition.blockX;
|
int i = movingobjectposition.blockX;
|
||||||
int j = movingobjectposition.blockY;
|
int j = movingobjectposition.blockY;
|
||||||
int k = movingobjectposition.blockZ;
|
int k = movingobjectposition.blockZ;
|
||||||
|
|
@ -31,7 +31,7 @@ public class ItemOrbWater extends ItemOrb {
|
||||||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
if (world.getBlock(i, j, k).getMaterial() == Material.water && world.getBlockMetadata(i, j, k) == 0) {
|
if (world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0) {
|
||||||
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||||
world.setBlockToAir(i, j, k);
|
world.setBlockToAir(i, j, k);
|
||||||
itemStack.damageItem(1, entityPlayer);
|
itemStack.damageItem(1, entityPlayer);
|
||||||
|
|
@ -58,10 +58,10 @@ public class ItemOrbWater extends ItemOrb {
|
||||||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
} else {
|
} else {
|
||||||
Block i1 = world.getBlock(i, j, k);
|
int i1 = world.getBlockId(i, j, k);
|
||||||
if (i1 == Blocks.air) {
|
if (i1 == 0) {
|
||||||
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||||
world.setBlock(i, j, k, Blocks.flowing_water);
|
world.setBlock(i, j, k, Block.waterMoving.blockID);
|
||||||
itemStack.damageItem(1, entityPlayer);
|
itemStack.damageItem(1, entityPlayer);
|
||||||
}
|
}
|
||||||
return itemStack;
|
return itemStack;
|
||||||
|
|
@ -74,8 +74,14 @@ public class ItemOrbWater extends ItemOrb {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||||
if (par5) {
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
MysticWorld.proxy.waterFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||||
|
if (itemStack != null) {
|
||||||
|
if (currentItem != null) {
|
||||||
|
if (currentItem.itemID == itemStack.itemID) {
|
||||||
|
MysticWorld.proxy.waterFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,17 @@
|
||||||
package mysticworld.items;
|
package mysticworld.items;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
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 mysticworld.MysticWorld;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
|
|
||||||
public class ItemStaff extends Item {
|
public class ItemStaff extends Item {
|
||||||
public ItemStaff() {
|
Random rand = new Random();
|
||||||
super();
|
|
||||||
|
public ItemStaff(int id) {
|
||||||
|
super(id);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
this.setMaxDamage(200);
|
this.setMaxDamage(200);
|
||||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
|
|
@ -19,9 +22,4 @@ public class ItemStaff extends Item {
|
||||||
public boolean isFull3D() {
|
public boolean isFull3D() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerIcons(IIconRegister par1IconRegister) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,52 +5,76 @@ import mysticworld.entity.EntityChargeAir;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
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.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import org.lwjgl.input.Mouse;
|
||||||
|
|
||||||
public class ItemStaffAir extends ItemStaff {
|
public class ItemStaffAir extends ItemStaff {
|
||||||
public ItemStaffAir() {
|
public ItemStaffAir(int id) {
|
||||||
super();
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
|
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
|
||||||
player.setItemInUse(itemStack, this.getMaxItemUseDuration(itemStack));
|
if (itemStack.stackTagCompound == null)
|
||||||
|
itemStack.setTagCompound(new NBTTagCompound());
|
||||||
|
if (itemStack.stackTagCompound.getBoolean("charging") == false) {
|
||||||
|
itemStack.stackTagCompound.setBoolean("charging", true);
|
||||||
|
}
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxItemUseDuration(ItemStack itemStack){
|
|
||||||
return 5*20;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlayerStoppedUsing(ItemStack itemStack, World world, EntityPlayer player, int time) {
|
|
||||||
int charge = getMaxItemUseDuration(itemStack)-time;
|
|
||||||
if (charge > 0) {
|
|
||||||
world.playAuxSFXAtEntity(player, 1009, (int) player.posX, (int) player.posY, (int) player.posZ, 0);
|
|
||||||
if (!world.isRemote)
|
|
||||||
world.spawnEntityInWorld(new EntityChargeAir(world, player, 1.0f + charge * (5.0f * (1 / (float) getMaxItemUseDuration(itemStack))), charge * (2.5D * (1.0D / getMaxItemUseDuration(itemStack)))));
|
|
||||||
itemStack.damageItem(1, player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean current) {
|
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||||
if (current) {
|
if (itemStack.stackTagCompound == null)
|
||||||
entity.fallDistance = 0.0F;
|
itemStack.setTagCompound(new NBTTagCompound());
|
||||||
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
|
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||||
|
itemStack.stackTagCompound.setInteger("maxChargeTime", 3 * 20);
|
||||||
|
if (currentItem != null) {
|
||||||
|
if (currentItem.itemID == itemStack.itemID) {
|
||||||
|
player.fallDistance = 0.0F;
|
||||||
|
chargeEffect(itemStack, world, player);
|
||||||
|
if (!Mouse.isButtonDown(1)) {
|
||||||
|
if (itemStack.stackTagCompound.getInteger("chargeTime") > 0) {
|
||||||
|
if (!world.isRemote) {
|
||||||
|
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) player.posX, (int) player.posY, (int) player.posZ, 0);
|
||||||
|
world.spawnEntityInWorld(new EntityChargeAir(world, player, 1.0f + ((itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float) itemStack.stackTagCompound
|
||||||
|
.getInteger("maxChargeTime")))), (itemStack.stackTagCompound.getInteger("chargeTime")) * (2.5D * (1.0D / itemStack.stackTagCompound.getInteger("maxChargeTime")))));
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resetData(itemStack);
|
||||||
|
} else {
|
||||||
|
if (itemStack.stackTagCompound.getBoolean("charging") == true) {
|
||||||
|
incrementData(itemStack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetData(itemStack);
|
||||||
|
}
|
||||||
|
if (itemStack.stackTagCompound.getInteger("chargeTime") > itemStack.stackTagCompound.getInteger("maxChargeTime")) {
|
||||||
|
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("maxChargeTime"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private void chargeEffect(ItemStack itemStack, World world, EntityPlayer player) {
|
||||||
public void onUsingTick(ItemStack stack, EntityPlayer player, int count){
|
double particleX = (player.posX - 0.5D) + rand.nextDouble();
|
||||||
chargeEffect(stack, player.worldObj, player, getMaxItemUseDuration(stack) - count);
|
double particleY = player.posY + (player.height / itemStack.stackTagCompound.getInteger("maxChargeTime") * itemStack.stackTagCompound.getInteger("chargeTime"));
|
||||||
}
|
double particleZ = (player.posZ - 0.5D) + rand.nextDouble();
|
||||||
|
float particleScale = ((itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float) itemStack.stackTagCompound.getInteger("maxChargeTime"))));
|
||||||
|
if (!world.isRemote)
|
||||||
|
MysticWorld.proxy.airFeetFX(world, particleX, particleY, particleZ, 1.0f + particleScale, 15);
|
||||||
|
}
|
||||||
|
|
||||||
private void chargeEffect(ItemStack itemStack, World world, Entity player, int charge) {
|
private void incrementData(ItemStack itemStack) {
|
||||||
double particleX = (player.posX - 0.5D) + itemRand.nextDouble();
|
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1);
|
||||||
double particleY = player.posY + (charge * player.height / getMaxItemUseDuration(itemStack));
|
}
|
||||||
double particleZ = (player.posZ - 0.5D) + itemRand.nextDouble();
|
|
||||||
float particleScale = charge * (5.0f * (1 / (float) getMaxItemUseDuration(itemStack)));
|
private void resetData(ItemStack itemStack) {
|
||||||
MysticWorld.proxy.airFeetFX(world, particleX, particleY, particleZ, 1.0f + particleScale, 15);
|
itemStack.stackTagCompound.setInteger("chargeTime", 0);
|
||||||
|
itemStack.stackTagCompound.setBoolean("charging", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,25 +2,40 @@ package mysticworld.items;
|
||||||
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import mysticworld.entity.EntityChargeEarth;
|
import mysticworld.entity.EntityChargeEarth;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockCocoa;
|
||||||
|
import net.minecraft.block.BlockCrops;
|
||||||
|
import net.minecraft.block.BlockDirectional;
|
||||||
|
import net.minecraft.block.BlockMushroom;
|
||||||
|
import net.minecraft.block.BlockSapling;
|
||||||
|
import net.minecraft.block.BlockStem;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
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.EnumMovingObjectType;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.event.Event.Result;
|
||||||
|
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||||
|
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
public class ItemStaffEarth extends ItemStaff {
|
public class ItemStaffEarth extends ItemStaff {
|
||||||
public ItemStaffEarth() {
|
public ItemStaffEarth(int id) {
|
||||||
super();
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
||||||
if (entityPlayer.isSneaking()) {
|
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
||||||
if (movingobjectposition == null) {
|
if (movingobjectposition == null) {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
} else {
|
} else {
|
||||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
|
||||||
int i = movingobjectposition.blockX;
|
int i = movingobjectposition.blockX;
|
||||||
int j = movingobjectposition.blockY;
|
int j = movingobjectposition.blockY;
|
||||||
int k = movingobjectposition.blockZ;
|
int k = movingobjectposition.blockZ;
|
||||||
|
|
@ -40,7 +55,7 @@ public class ItemStaffEarth extends ItemStaff {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
world.spawnEntityInWorld(new EntityChargeEarth(world, entityPlayer));
|
world.spawnEntityInWorld(new EntityChargeEarth(world, entityPlayer));
|
||||||
itemStack.damageItem(1, entityPlayer);
|
itemStack.damageItem(1, entityPlayer);
|
||||||
|
|
@ -52,12 +67,125 @@ public class ItemStaffEarth extends ItemStaff {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||||
if (par5) {
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
MysticWorld.proxy.earthFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||||
|
if (!world.isRemote) {
|
||||||
|
if (currentItem != null) {
|
||||||
|
if (currentItem.itemID == itemStack.itemID) {
|
||||||
|
MysticWorld.proxy.earthFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean applyBonemeal(ItemStack itemStack, World par1World, int par2, int par3, int par4, EntityPlayer player) {
|
public static boolean applyBonemeal(ItemStack itemStack, World par1World, int par2, int par3, int par4, EntityPlayer player) {
|
||||||
return ItemOrbEarth.applyBonemeal(itemStack, par1World, par2, par3, par4, player);
|
int l = par1World.getBlockId(par2, par3, par4);
|
||||||
|
BonemealEvent event = new BonemealEvent(player, par1World, l, par2, par3, par4);
|
||||||
|
if (MinecraftForge.EVENT_BUS.post(event)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (event.getResult() == Result.ALLOW) {
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (l == Block.sapling.blockID) {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
if (par1World.rand.nextFloat() < 0.45D) {
|
||||||
|
((BlockSapling) Block.sapling).markOrGrowMarked(par1World, par2, par3, par4, par1World.rand);
|
||||||
|
}
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else if (l == Block.cobblestone.blockID) {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
par1World.setBlock(par2, par3, par4, Block.cobblestoneMossy.blockID);
|
||||||
|
}
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
} else if (l == Block.deadBush.blockID) {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
par1World.setBlock(par2, par3, par4, 0);
|
||||||
|
par1World.spawnEntityInWorld(new EntityItem(par1World, par2, par3, par4, new ItemStack(Block.sapling, 1)));
|
||||||
|
}
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
} else if (l != Block.mushroomBrown.blockID && l != Block.mushroomRed.blockID) {
|
||||||
|
if (l != Block.melonStem.blockID && l != Block.pumpkinStem.blockID) {
|
||||||
|
if (l > 0 && Block.blocksList[l] instanceof BlockCrops) {
|
||||||
|
if (par1World.getBlockMetadata(par2, par3, par4) == 7) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
((BlockCrops) Block.blocksList[l]).fertilize(par1World, par2, par3, par4);
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int i1;
|
||||||
|
int j1;
|
||||||
|
int k1;
|
||||||
|
if (l == Block.cocoaPlant.blockID) {
|
||||||
|
i1 = par1World.getBlockMetadata(par2, par3, par4);
|
||||||
|
j1 = BlockDirectional.getDirection(i1);
|
||||||
|
k1 = BlockCocoa.func_72219_c(i1);
|
||||||
|
if (k1 >= 2) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
++k1;
|
||||||
|
par1World.setBlockMetadataWithNotify(par2, par3, par4, k1 << 2 | j1, 2);
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if (l != Block.grass.blockID) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
label102: for (i1 = 0; i1 < 128; ++i1) {
|
||||||
|
j1 = par2;
|
||||||
|
k1 = par3 + 1;
|
||||||
|
int l1 = par4;
|
||||||
|
for (int i2 = 0; i2 < i1 / 16; ++i2) {
|
||||||
|
j1 += itemRand.nextInt(3) - 1;
|
||||||
|
k1 += (itemRand.nextInt(3) - 1) * itemRand.nextInt(3) / 2;
|
||||||
|
l1 += itemRand.nextInt(3) - 1;
|
||||||
|
if (par1World.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || par1World.isBlockNormalCube(j1, k1, l1)) {
|
||||||
|
continue label102;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (par1World.getBlockId(j1, k1, l1) == 0) {
|
||||||
|
if (itemRand.nextInt(10) != 0) {
|
||||||
|
if (Block.tallGrass.canBlockStay(par1World, j1, k1, l1)) {
|
||||||
|
par1World.setBlock(j1, k1, l1, Block.tallGrass.blockID, 1, 3);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ForgeHooks.plantGrass(par1World, j1, k1, l1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (par1World.getBlockMetadata(par2, par3, par4) == 7) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
((BlockStem) Block.blocksList[l]).fertilizeStem(par1World, par2, par3, par4);
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!par1World.isRemote) {
|
||||||
|
if (par1World.rand.nextFloat() < 0.4D) {
|
||||||
|
((BlockMushroom) Block.blocksList[l]).fertilizeMushroom(par1World, par2, par3, par4, par1World.rand);
|
||||||
|
}
|
||||||
|
itemStack.damageItem(1, player);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,22 +8,25 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.util.EnumMovingObjectType;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
public class ItemStaffEnegy extends ItemStaff {
|
public class ItemStaffEnegy extends ItemStaff {
|
||||||
public ItemStaffEnegy() {
|
public ItemStaffEnegy(int id) {
|
||||||
super();
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
||||||
if (entityPlayer.isSneaking()) {
|
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
||||||
if (movingobjectposition == null) {
|
if (movingobjectposition == null) {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
} else {
|
} else {
|
||||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
|
||||||
int i = movingobjectposition.blockX;
|
int i = movingobjectposition.blockX;
|
||||||
int j = movingobjectposition.blockY;
|
int j = movingobjectposition.blockY;
|
||||||
int k = movingobjectposition.blockZ;
|
int k = movingobjectposition.blockZ;
|
||||||
|
|
@ -56,7 +59,7 @@ public class ItemStaffEnegy extends ItemStaff {
|
||||||
} else {
|
} else {
|
||||||
if (world.isAirBlock(i, j, k)) {
|
if (world.isAirBlock(i, j, k)) {
|
||||||
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||||
world.setBlock(i, j, k, BlockHandler.lightCube);
|
world.setBlock(i, j, k, BlockHandler.lightCube.blockID);
|
||||||
}
|
}
|
||||||
itemStack.damageItem(1, entityPlayer);
|
itemStack.damageItem(1, entityPlayer);
|
||||||
return itemStack;
|
return itemStack;
|
||||||
|
|
@ -65,7 +68,7 @@ public class ItemStaffEnegy extends ItemStaff {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
world.spawnEntityInWorld(new EntityChargeEnergy(world, entityPlayer));
|
world.spawnEntityInWorld(new EntityChargeEnergy(world, entityPlayer));
|
||||||
itemStack.damageItem(1, entityPlayer);
|
itemStack.damageItem(1, entityPlayer);
|
||||||
|
|
@ -77,9 +80,15 @@ public class ItemStaffEnegy extends ItemStaff {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||||
if (entity instanceof EntityPlayer && par5) {
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
((EntityPlayer)entity).addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2));
|
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||||
MysticWorld.proxy.energyFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
if (!world.isRemote) {
|
||||||
|
if (currentItem != null) {
|
||||||
|
if (currentItem.itemID == itemStack.itemID) {
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2));
|
||||||
|
MysticWorld.proxy.energyFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,26 +3,27 @@ package mysticworld.items;
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import mysticworld.entity.EntityChargeFire;
|
import mysticworld.entity.EntityChargeFire;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.EnumMovingObjectType;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
public class ItemStaffFire extends ItemStaff {
|
public class ItemStaffFire extends ItemStaff {
|
||||||
public ItemStaffFire() {
|
public ItemStaffFire(int id) {
|
||||||
super();
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving) {
|
||||||
public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityPlayer, EntityLivingBase entityLiving) {
|
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||||
if (entityPlayer.isSneaking()) {
|
|
||||||
entityLiving.setFire(5);
|
entityLiving.setFire(5);
|
||||||
entityLiving.attackEntityFrom(DamageSource.magic, 7);
|
entityLiving.attackEntityFrom(DamageSource.magic, 7);
|
||||||
itemStack.damageItem(1, entityLiving);
|
itemStack.damageItem(1, entityLiving);
|
||||||
|
|
@ -33,12 +34,12 @@ public class ItemStaffFire extends ItemStaff {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
||||||
if (entityPlayer.isSneaking()) {
|
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
||||||
if (movingobjectposition == null) {
|
if (movingobjectposition == null) {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
} else {
|
} else {
|
||||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
|
||||||
int i = movingobjectposition.blockX;
|
int i = movingobjectposition.blockX;
|
||||||
int j = movingobjectposition.blockY;
|
int j = movingobjectposition.blockY;
|
||||||
int k = movingobjectposition.blockZ;
|
int k = movingobjectposition.blockZ;
|
||||||
|
|
@ -48,12 +49,12 @@ public class ItemStaffFire extends ItemStaff {
|
||||||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
} else {
|
} else {
|
||||||
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(world.getBlock(i, j, k), 1, world.getBlockMetadata(i, j, k)));
|
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(world.getBlockId(i, j, k), 1, world.getBlockMetadata(i, j, k)));
|
||||||
if (!world.isRemote && result != null) {
|
if (!world.isRemote && !(result == null)) {
|
||||||
Item id = result.getItem();
|
int id = result.itemID;
|
||||||
int meta = result.getItemDamage();
|
int meta = result.getItemDamage();
|
||||||
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||||
world.setBlockToAir(i, j, k);
|
world.setBlock(i, j, k, 0);
|
||||||
world.spawnEntityInWorld(new EntityItem(world, i, j, k, new ItemStack(id, 1, meta)));
|
world.spawnEntityInWorld(new EntityItem(world, i, j, k, new ItemStack(id, 1, meta)));
|
||||||
itemStack.damageItem(1, entityPlayer);
|
itemStack.damageItem(1, entityPlayer);
|
||||||
}
|
}
|
||||||
|
|
@ -61,7 +62,7 @@ public class ItemStaffFire extends ItemStaff {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
world.spawnEntityInWorld(new EntityChargeFire(world, entityPlayer));
|
world.spawnEntityInWorld(new EntityChargeFire(world, entityPlayer));
|
||||||
itemStack.damageItem(1, entityPlayer);
|
itemStack.damageItem(1, entityPlayer);
|
||||||
|
|
@ -81,9 +82,15 @@ public class ItemStaffFire extends ItemStaff {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||||
if (entity instanceof EntityPlayer && par5) {
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
((EntityPlayer)entity).addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0));
|
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||||
MysticWorld.proxy.fireFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
if (!world.isRemote) {
|
||||||
|
if (currentItem != null) {
|
||||||
|
if (currentItem.itemID == itemStack.itemID) {
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0));
|
||||||
|
MysticWorld.proxy.fireFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,37 @@
|
||||||
package mysticworld.items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticworld.MysticWorld;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Icon;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemStaffParts extends Item {
|
public class ItemStaffParts extends Item {
|
||||||
private IIcon[] icons;
|
private Icon[] icons;
|
||||||
private static final String[] STAFF_PARTS = new String[] { "Staff", "Hilt", "Handle", "Head" };
|
private static final String[] STAFF_PARTS = new String[] { "Staff", "Hilt", "Handle", "Head" };
|
||||||
|
|
||||||
public ItemStaffParts() {
|
public ItemStaffParts(int id) {
|
||||||
super();
|
super(id);
|
||||||
this.setHasSubtypes(true);
|
this.setHasSubtypes(true);
|
||||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIconFromDamage(int meta) {
|
public Icon getIconFromDamage(int meta) {
|
||||||
int j = MathHelper.clamp_int(meta, 0, STAFF_PARTS.length);
|
int j = MathHelper.clamp_int(meta, 0, STAFF_PARTS.length);
|
||||||
return icons[j];
|
return icons[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||||
for (int var4 = 0; var4 < STAFF_PARTS.length; var4++) {
|
for (int var4 = 0; var4 < STAFF_PARTS.length; var4++) {
|
||||||
par3List.add(new ItemStack(par1, 1, var4));
|
par3List.add(new ItemStack(par1, 1, var4));
|
||||||
}
|
}
|
||||||
|
|
@ -51,10 +51,10 @@ public class ItemStaffParts extends Item {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
icons = new IIcon[STAFF_PARTS.length];
|
icons = new Icon[STAFF_PARTS.length];
|
||||||
for (int i = 0; i < STAFF_PARTS.length; ++i) {
|
for (int i = 0; i < STAFF_PARTS.length; ++i) {
|
||||||
icons[i] = iconRegister.registerIcon("mysticworld:StaffPart_" + STAFF_PARTS[i]);
|
icons[i] = iconRegister.registerIcon("MysticMods:StaffPart_" + STAFF_PARTS[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
43
common/MysticWorld/Items/ItemStaffPower.java
Normal file
43
common/MysticWorld/Items/ItemStaffPower.java
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
package mysticworld.items;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Icon;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class ItemStaffPower extends Item {
|
||||||
|
private Icon[] icons;
|
||||||
|
private static final String[] CHARGE_NAMES = new String[] { "Fire", "Water", "Earth", "Air", "Energy" };
|
||||||
|
|
||||||
|
public ItemStaffPower(int id) {
|
||||||
|
super(id);
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.setCreativeTab(null);
|
||||||
|
maxStackSize = 64;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Icon getIconFromDamage(int meta) {
|
||||||
|
int j = MathHelper.clamp_int(meta, 0, 5);
|
||||||
|
return icons[j];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemStack) {
|
||||||
|
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5);
|
||||||
|
return super.getUnlocalizedName() + CHARGE_NAMES[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
icons = new Icon[CHARGE_NAMES.length];
|
||||||
|
for (int i = 0; i < CHARGE_NAMES.length; ++i) {
|
||||||
|
icons[i] = iconRegister.registerIcon("MysticMods:Charge" + CHARGE_NAMES[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,14 +6,16 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumMovingObjectType;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
public class ItemStaffWater extends ItemStaff {
|
public class ItemStaffWater extends ItemStaff {
|
||||||
public ItemStaffWater() {
|
public ItemStaffWater(int id) {
|
||||||
super();
|
super(id);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
this.setMaxDamage(200);
|
this.setMaxDamage(200);
|
||||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
|
|
@ -21,12 +23,12 @@ public class ItemStaffWater extends ItemStaff {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
||||||
if (entityPlayer.isSneaking()) {
|
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
||||||
if (movingobjectposition == null) {
|
if (movingobjectposition == null) {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
} else {
|
} else {
|
||||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
|
||||||
int i = movingobjectposition.blockX;
|
int i = movingobjectposition.blockX;
|
||||||
int j = movingobjectposition.blockY;
|
int j = movingobjectposition.blockY;
|
||||||
int k = movingobjectposition.blockZ;
|
int k = movingobjectposition.blockZ;
|
||||||
|
|
@ -36,7 +38,7 @@ public class ItemStaffWater extends ItemStaff {
|
||||||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
if (world.getBlock(i, j, k).getMaterial() == Material.water && world.getBlockMetadata(i, j, k) == 0) {
|
if (world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0) {
|
||||||
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||||
world.setBlockToAir(i, j, k);
|
world.setBlockToAir(i, j, k);
|
||||||
itemStack.damageItem(1, entityPlayer);
|
itemStack.damageItem(1, entityPlayer);
|
||||||
|
|
@ -63,10 +65,10 @@ public class ItemStaffWater extends ItemStaff {
|
||||||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
} else {
|
} else {
|
||||||
Block i1 = world.getBlock(i, j, k);
|
int i1 = world.getBlockId(i, j, k);
|
||||||
if (i1 == Blocks.air) {
|
if (i1 == 0) {
|
||||||
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||||
world.setBlock(i, j, k, Blocks.flowing_water);
|
world.setBlock(i, j, k, Block.waterMoving.blockID);
|
||||||
itemStack.damageItem(1, entityPlayer);
|
itemStack.damageItem(1, entityPlayer);
|
||||||
}
|
}
|
||||||
return itemStack;
|
return itemStack;
|
||||||
|
|
@ -76,7 +78,7 @@ public class ItemStaffWater extends ItemStaff {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
world.spawnEntityInWorld(new EntityChargeWater(world, entityPlayer));
|
world.spawnEntityInWorld(new EntityChargeWater(world, entityPlayer));
|
||||||
itemStack.damageItem(1, entityPlayer);
|
itemStack.damageItem(1, entityPlayer);
|
||||||
|
|
@ -87,8 +89,14 @@ public class ItemStaffWater extends ItemStaff {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||||
if (par5) {
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
MysticWorld.proxy.waterFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||||
|
if (!world.isRemote) {
|
||||||
|
if (currentItem != null) {
|
||||||
|
if (currentItem.itemID == itemStack.itemID) {
|
||||||
|
MysticWorld.proxy.waterFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,19 +1,20 @@
|
||||||
package mysticworld.items;
|
package mysticworld.items;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import java.util.List;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
|
import net.minecraft.client.renderer.texture.IconRegister;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import java.util.List;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemVoidShard extends Item {
|
public class ItemVoidShard extends Item {
|
||||||
public ItemVoidShard() {
|
public ItemVoidShard(int id) {
|
||||||
super();
|
super(id);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||||
this.setMaxDamage(1);
|
this.setMaxDamage(1);
|
||||||
|
|
@ -28,7 +29,7 @@ public class ItemVoidShard extends Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasEffect(ItemStack itemStack, int i) {
|
public boolean hasEffect(ItemStack itemStack) {
|
||||||
if (itemStack.stackTagCompound == null)
|
if (itemStack.stackTagCompound == null)
|
||||||
itemStack.setTagCompound(new NBTTagCompound());
|
itemStack.setTagCompound(new NBTTagCompound());
|
||||||
if (itemStack.stackTagCompound.hasKey("filled")) {
|
if (itemStack.stackTagCompound.hasKey("filled")) {
|
||||||
|
|
@ -44,7 +45,7 @@ public class ItemVoidShard extends Item {
|
||||||
itemStack.setTagCompound(new NBTTagCompound());
|
itemStack.setTagCompound(new NBTTagCompound());
|
||||||
int experience = entityPlayer.experienceLevel;
|
int experience = entityPlayer.experienceLevel;
|
||||||
int experienceSubtract = entityPlayer.experienceLevel - 30;
|
int experienceSubtract = entityPlayer.experienceLevel - 30;
|
||||||
if (!itemStack.stackTagCompound.getBoolean("filled")) {
|
if (itemStack.stackTagCompound.getBoolean("filled") == false) {
|
||||||
if (experience > 0 && experience <= 30) {
|
if (experience > 0 && experience <= 30) {
|
||||||
entityPlayer.experienceLevel = 0;
|
entityPlayer.experienceLevel = 0;
|
||||||
itemStack.stackTagCompound.setInteger("xpStored", experience);
|
itemStack.stackTagCompound.setInteger("xpStored", experience);
|
||||||
|
|
@ -62,4 +63,10 @@ public class ItemVoidShard extends Item {
|
||||||
}
|
}
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IconRegister iconRegister) {
|
||||||
|
itemIcon = iconRegister.registerIcon("MysticMods:ShardVoid");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
49
common/MysticWorld/Lib/BlockIds.java
Normal file
49
common/MysticWorld/Lib/BlockIds.java
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
package mysticworld.lib;
|
||||||
|
|
||||||
|
public class BlockIds {
|
||||||
|
|
||||||
|
//Default Block IDs
|
||||||
|
public static int ORE_STONE_1_DEFAULT = 600;
|
||||||
|
|
||||||
|
public static int BUSH_DEFAULT = 601;
|
||||||
|
public static int POISON_BUSH_DEFAULT = 602;
|
||||||
|
public static int WEAKNESS_BUSH_DEFAULT = 603;
|
||||||
|
public static int SLOWNESS_BUSH_DEFAULT = 604;
|
||||||
|
public static int HARMING_BUSH_DEFAULT = 605;
|
||||||
|
public static int WITHER_BUSH_DEFAULT = 606;
|
||||||
|
public static int HEALTH_BUSH_DEFAULT = 607;
|
||||||
|
public static int SPEED_BUSH_DEFAULT = 608;
|
||||||
|
public static int FIRE_RESISTANCE_BUSH_DEFAULT = 609;
|
||||||
|
public static int REGEN_BUSH_DEFAULT = 610;
|
||||||
|
public static int NIGHT_VISION_BUSH_DEFAULT = 611;
|
||||||
|
public static int INVISIBILITY_BUSH_DEFAULT = 612;
|
||||||
|
|
||||||
|
public static int LIGHT_CUBE_DEFAULT = 613;
|
||||||
|
|
||||||
|
public static int PLATFORM_DEFAULT = 614;
|
||||||
|
public static int PILLAR_DEFAULT = 615;
|
||||||
|
public static int PILLAR_INSERT_DEFAULT = 616;
|
||||||
|
|
||||||
|
//Current Block IDs
|
||||||
|
public static int ORE_STONE_1;
|
||||||
|
|
||||||
|
public static int BUSH;
|
||||||
|
public static int POISON_BUSH;
|
||||||
|
public static int WEAKNESS_BUSH;
|
||||||
|
public static int SLOWNESS_BUSH;
|
||||||
|
public static int HARMING_BUSH;
|
||||||
|
public static int WITHER_BUSH;
|
||||||
|
public static int HEALTH_BUSH;
|
||||||
|
public static int SPEED_BUSH;
|
||||||
|
public static int FIRE_RESISTANCE_BUSH;
|
||||||
|
public static int REGEN_BUSH;
|
||||||
|
public static int NIGHT_VISION_BUSH;
|
||||||
|
public static int INVISIBILITY_BUSH;
|
||||||
|
|
||||||
|
public static int LIGHT_CUBE;
|
||||||
|
|
||||||
|
public static int PLATFORM;
|
||||||
|
public static int PILLAR;
|
||||||
|
public static int PILLAR_INSERT;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,6 @@ package mysticworld.lib;
|
||||||
|
|
||||||
public class Booleans
|
public class Booleans
|
||||||
{
|
{
|
||||||
public static boolean ENABLE_IMBUED_STONE_GEN;
|
|
||||||
public static boolean ENABLE_BUSH_GEN;
|
public static boolean ENABLE_BUSH_GEN;
|
||||||
public static boolean ENABLE_GLACIER_GEN;
|
public static boolean ENABLE_GLACIER_GEN;
|
||||||
public static boolean ENABLE_JUNGLE_REWRITE;
|
public static boolean ENABLE_JUNGLE_REWRITE;
|
||||||
|
|
|
||||||
14
common/MysticWorld/Lib/EntityIds.java
Normal file
14
common/MysticWorld/Lib/EntityIds.java
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
package mysticworld.lib;
|
||||||
|
|
||||||
|
public class EntityIds {
|
||||||
|
|
||||||
|
//Entity IDs
|
||||||
|
public static int ENTITY_AIR_CHARGE = 1;
|
||||||
|
public static int ENTITY_FIREBALL = 2;
|
||||||
|
public static int ENTITY_EARTH_CHARGE = 3;
|
||||||
|
public static int ENTITY_ENERGY_CHARGE = 4;
|
||||||
|
public static int ENTITY_WATER_CHARGE = 5;
|
||||||
|
|
||||||
|
public static int ENTITY_PIGMAN = 6;
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue