Config options and fixes #15
366 changed files with 7640 additions and 8263 deletions
231
.gitignore
vendored
231
.gitignore
vendored
|
|
@ -1,220 +1,13 @@
|
|||
#################
|
||||
## Eclipse
|
||||
#################
|
||||
/common/*
|
||||
|
||||
*.pydevproject
|
||||
.project
|
||||
.metadata
|
||||
common/bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.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/*
|
||||
!.gitignore
|
||||
!*LICENSE.md
|
||||
!README.md
|
||||
!common/assets/
|
||||
!common/mysticores/
|
||||
!common/mysticruins/
|
||||
!common/mysticstones/
|
||||
!common/mysticworld/
|
||||
!common/mcmod.info
|
||||
!common/build.gradle
|
||||
!common/gradle*
|
||||
63
MysticMods.iml
Normal file
63
MysticMods.iml
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?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>
|
||||
14
common/MysticMods.eml
Normal file
14
common/MysticMods.eml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?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>
|
||||
46
common/MysticMods_common.iml
Normal file
46
common/MysticMods_common.iml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?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,31 +1,37 @@
|
|||
package mysticores.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
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.IconRegister;
|
||||
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.Icon;
|
||||
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.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBase extends Block {
|
||||
Icon[] textures;
|
||||
IIcon[] textures;
|
||||
|
||||
public BlockBase(int ID) {
|
||||
super(ID, Material.rock);
|
||||
setCreativeTab(MysticOres.MysticOresTab);
|
||||
public BlockBase() {
|
||||
super(Material.rock);
|
||||
setCreativeTab(MysticOres.MysticOresTab);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
setHarvestLevel("pickaxe", 3, 0);
|
||||
setHarvestLevel("pickaxe", 3, 2);
|
||||
setHarvestLevel("pickaxe", 1, 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -74,7 +80,7 @@ public class BlockBase extends Block {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIcon(int side, int meta) {
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
|
|
@ -95,14 +101,14 @@ public class BlockBase extends Block {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||
for (int meta = 0; meta < ItemBase.BLOCK_NAMES.length; meta++) {
|
||||
public void getSubBlocks(Item i, CreativeTabs tab, List list) {
|
||||
for (int meta = 0; meta < BlockHandler.BLOCK_NAMES.size(); meta++) {
|
||||
list.add(new ItemStack(i, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random random, int par3) {
|
||||
public Item getItemDropped(int par1, Random random, int par3) {
|
||||
switch (par1) {
|
||||
case 1:
|
||||
case 2:
|
||||
|
|
@ -111,25 +117,20 @@ public class BlockBase extends Block {
|
|||
case 7:
|
||||
case 11:
|
||||
case 12:
|
||||
return Items.Resource.itemID;
|
||||
return Items.Resource;
|
||||
case 8:
|
||||
return this.BlackSoulstoneDrops(par1, random, par3);
|
||||
return BlackSoulstoneDrops(par1, random, par3);
|
||||
case 9:
|
||||
return this.BlueSoulstoneDrops(par1, random, par3);
|
||||
return BlueSoulstoneDrops(par1, random, par3);
|
||||
case 10:
|
||||
return this.RedSoulstoneDrops(par1, random, par3);
|
||||
return RedSoulstoneDrops(par1, random, par3);
|
||||
default:
|
||||
return blockID;
|
||||
return super.getItemDropped(par1, random, par3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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) {
|
||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 12)
|
||||
return false;
|
||||
|
|
@ -138,9 +139,9 @@ public class BlockBase extends Block {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(int meta, int fortune, Random random) {
|
||||
|
|
@ -164,79 +165,72 @@ public class BlockBase extends Block {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister register) {
|
||||
textures = new Icon[16];
|
||||
for (int i = 0; i < ItemBase.BLOCK_NAMES.length; i++) {
|
||||
textures[i] = register.registerIcon("MysticMods:" + ItemBase.BLOCK_NAMES[i]);
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
textures = new IIcon[16];
|
||||
for (int i = 0; i < BlockHandler.BLOCK_NAMES.size(); i++) {
|
||||
textures[i] = register.registerIcon("mysticores:" + BlockHandler.BLOCK_NAMES.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int par) {
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int blockID = world.getBlockId(x, y, z);
|
||||
if (meta == 12 && blockID == this.blockID)
|
||||
return false;
|
||||
else
|
||||
if (meta == 12 && world.getBlock(x, y, z) == this){
|
||||
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);
|
||||
}else
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static int BlackSoulstoneDrops(int par1, Random random, int par3) {
|
||||
public static Item BlackSoulstoneDrops(int par1, Random random, int par3) {
|
||||
int rand = random.nextInt(2);
|
||||
switch (rand) {
|
||||
case 0:
|
||||
return Item.coal.itemID;
|
||||
return net.minecraft.init.Items.coal;
|
||||
case 1:
|
||||
return Item.gunpowder.itemID;
|
||||
return net.minecraft.init.Items.gunpowder;
|
||||
default:
|
||||
return Item.sugar.itemID;
|
||||
return net.minecraft.init.Items.sugar;
|
||||
}
|
||||
}
|
||||
|
||||
public static int BlueSoulstoneDrops(int par1, Random random, int par3) {
|
||||
public static Item BlueSoulstoneDrops(int par1, Random random, int par3) {
|
||||
int rand = random.nextInt(5);
|
||||
switch (rand) {
|
||||
case 0:
|
||||
return Item.diamond.itemID;
|
||||
return net.minecraft.init.Items.diamond;
|
||||
case 1:
|
||||
return Block.obsidian.blockID;
|
||||
return Item.getItemFromBlock(Blocks.obsidian);
|
||||
case 2:
|
||||
return Item.gunpowder.itemID;
|
||||
return net.minecraft.init.Items.gunpowder;
|
||||
case 3:
|
||||
return Item.glowstone.itemID;
|
||||
return net.minecraft.init.Items.glowstone_dust;
|
||||
case 4:
|
||||
return Item.blazeRod.itemID;
|
||||
return net.minecraft.init.Items.blaze_rod;
|
||||
case 5:
|
||||
return Item.emerald.itemID;
|
||||
default:
|
||||
return Item.emerald.itemID;
|
||||
return net.minecraft.init.Items.emerald;
|
||||
}
|
||||
}
|
||||
|
||||
public static int RedSoulstoneDrops(int par1, Random random, int par3) {
|
||||
public static Item RedSoulstoneDrops(int par1, Random random, int par3) {
|
||||
int rand = random.nextInt(4);
|
||||
switch (rand) {
|
||||
case 0:
|
||||
return Item.glowstone.itemID;
|
||||
return net.minecraft.init.Items.glowstone_dust;
|
||||
case 1:
|
||||
return Item.gunpowder.itemID;
|
||||
return net.minecraft.init.Items.gunpowder;
|
||||
case 2:
|
||||
return Item.redstone.itemID;
|
||||
return net.minecraft.init.Items.redstone;
|
||||
case 3:
|
||||
return Block.obsidian.blockID;
|
||||
return Item.getItemFromBlock(Blocks.obsidian);
|
||||
default:
|
||||
return Item.blazePowder.itemID;
|
||||
return net.minecraft.init.Items.blaze_powder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +1,17 @@
|
|||
package mysticores.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
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 int BASEID = 540;
|
||||
|
||||
public static void initialize() {
|
||||
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);
|
||||
BlockBase = GameRegistry.registerBlock(new BlockBase().setStepSound(Block.soundTypeStone), ItemBase.class, "Base Blocks", BLOCK_NAMES);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,22 @@
|
|||
package mysticores.blocks;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlockWithMetadata;
|
||||
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 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" };
|
||||
import java.util.ArrayList;
|
||||
|
||||
public ItemBase(int par1) {
|
||||
super(par1);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
return BlockHandler.BlockBase.getIcon(2, par1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
public class ItemBase extends ItemBlockWithMetadata {
|
||||
public final ArrayList<String> names;
|
||||
public ItemBase(Block block, ArrayList<String> names) {
|
||||
super(block, block);
|
||||
this.names = names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BLOCK_NAMES.length);
|
||||
return BLOCK_NAMES[meta];
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, names.size());
|
||||
return names.get(meta);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
package mysticores.items;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.EnumHelper;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class EnumTools
|
||||
{
|
||||
static EnumToolMaterial verditeToolMaterial = EnumHelper.addToolMaterial("Verdite", 1, 262, 5.0F, 1, 5);
|
||||
static EnumToolMaterial mithrilToolMaterial = EnumHelper.addToolMaterial("Mithril", 2, 500, 7.0F, 2, 9);
|
||||
static EnumToolMaterial adamantineToolMaterial = EnumHelper.addToolMaterial("Adamantine", 3, 3000, 10.0F, 5, 13);
|
||||
static EnumToolMaterial iridiumToolMaterial = EnumHelper.addToolMaterial("Iridium", 3, 4000, 12.0F, 7, 15);
|
||||
static EnumToolMaterial obsidianToolMaterial = EnumHelper.addToolMaterial("Obsidian", 2, 100, 4.0F, 6, 11);
|
||||
static EnumToolMaterial bloodstoneToolMaterial = EnumHelper.addToolMaterial("Bloodstone", 3, 200, 16.0F, 8, 12);
|
||||
public static final Item.ToolMaterial 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);
|
||||
public static final Item.ToolMaterial 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);
|
||||
public static final Item.ToolMaterial 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 { verditeToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; }
|
||||
static { mithrilToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; }
|
||||
static { adamantineToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; }
|
||||
static { iridiumToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; }
|
||||
static { obsidianToolMaterial.customCraftingMaterial = Item.itemsList[Block.obsidian.blockID]; }
|
||||
static { bloodstoneToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; }
|
||||
static {
|
||||
verditeToolMaterial.customCraftingMaterial = Items.Resource;
|
||||
mithrilToolMaterial.customCraftingMaterial = Items.Resource;
|
||||
adamantineToolMaterial.customCraftingMaterial = Items.Resource;
|
||||
iridiumToolMaterial.customCraftingMaterial = Items.Resource;
|
||||
obsidianToolMaterial.customCraftingMaterial = Item.getItemFromBlock(Blocks.obsidian);
|
||||
bloodstoneToolMaterial.customCraftingMaterial = Items.Resource;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
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));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
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));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
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,38 +1,36 @@
|
|||
package mysticores.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mysticores.MysticOres;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemResource extends Item {
|
||||
private Icon[] icons;
|
||||
private IIcon[] 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",
|
||||
"Amethyst Gem", "Mystic Powder", "Bloodstone Shard", "Glass Shard", "Obsidian Shard", "Obsidian Rod" };
|
||||
|
||||
public ItemResource(int id) {
|
||||
super(id);
|
||||
public ItemResource() {
|
||||
super();
|
||||
this.setHasSubtypes(true);
|
||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int meta) {
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
int j = MathHelper.clamp_int(meta, 0, RESOURCE_TYPES.length);
|
||||
return icons[j];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int var4 = 0; var4 < RESOURCE_TYPES.length; var4++)
|
||||
par3List.add(new ItemStack(par1, 1, var4));
|
||||
}
|
||||
|
|
@ -45,9 +43,9 @@ public class ItemResource extends Item {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
icons = new Icon[RESOURCE_TYPES.length];
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
icons = new IIcon[RESOURCE_TYPES.length];
|
||||
for (int i = 0; i < RESOURCE_TYPES.length; ++i)
|
||||
icons[i] = iconRegister.registerIcon("MysticMods:" + RESOURCE_TYPES[i]);
|
||||
icons[i] = iconRegister.registerIcon("mysticores:" + RESOURCE_TYPES[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +1,28 @@
|
|||
package mysticores.items;
|
||||
|
||||
import mysticores.MysticOres;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemSatchel extends Item {
|
||||
public ItemSatchel(int par1) {
|
||||
super(par1);
|
||||
setCreativeTab(MysticOres.MysticOresTab);
|
||||
maxStackSize = 1;
|
||||
public ItemSatchel() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack par1ItemStack) {
|
||||
public boolean hasEffect(ItemStack par1ItemStack, int i) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player) {
|
||||
if (!player.isSneaking()) {
|
||||
IInventory inv;
|
||||
inv = player.getInventoryEnderChest();
|
||||
player.displayGUIChest(inv);
|
||||
player.displayGUIChest(player.getInventoryEnderChest());
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
itemIcon = iconRegister.registerIcon("MysticMods" + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
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));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
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,74 +1,66 @@
|
|||
package mysticores.items;
|
||||
|
||||
import mysticores.lib.ItemID;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import mysticores.MysticOres;
|
||||
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 static Item VerditeSword;
|
||||
public static Item VerditePickaxe;
|
||||
public static Item VerditeShovel;
|
||||
public static Item VerditeAxe;
|
||||
public static Item VerditeHoe;
|
||||
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 VerditeSword, VerditePickaxe, VerditeShovel, VerditeAxe, VerditeHoe;
|
||||
public static Item MithrilSword, MithrilPickaxe, MithrilShovel, MithrilAxe, MithrilHoe;
|
||||
public static Item AdamantineSword, AdamantinePickaxe, AdamantineShovel, AdamantineAxe, AdamantineHoe;
|
||||
public static Item IridiumSword, IridiumPickaxe, IridiumShovel, IridiumAxe, IridiumHoe;
|
||||
public static Item BloodstoneSword, BloodstonePickaxe, BloodstoneShovel, BloodstoneAxe, BloodstoneHoe;
|
||||
public static Item ObsidianSword, ObsidianPickaxe, ObsidianShovel, ObsidianAxe, ObsidianHoe;
|
||||
public static Item Resource;
|
||||
public static Item Satchel;
|
||||
|
||||
public static void initialize() {
|
||||
Resource = new ItemResource(ItemID.RESOURCES);
|
||||
VerditeSword = new ItemSwords(ItemID.VERDITESWORD, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeSword");
|
||||
VerditePickaxe = new ItemPickaxes(ItemID.VERDITEPICKAXE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditePickaxe");
|
||||
VerditeShovel = new ItemShovels(ItemID.VERDITESHOVEL, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeShovel");
|
||||
VerditeAxe = new ItemAxes(ItemID.VERDITEAXE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeAxe");
|
||||
VerditeHoe = new ItemHoes(ItemID.VERDITEHOE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeHoe");
|
||||
MithrilSword = new ItemSwords(ItemID.MITHRILSWORD, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilSword");
|
||||
MithrilPickaxe = new ItemPickaxes(ItemID.MITHRILPICKAXE, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilPickaxe");
|
||||
MithrilShovel = new ItemShovels(ItemID.MITHRILSHOVEL, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilShovel");
|
||||
MithrilAxe = new ItemAxes(ItemID.MITHRILAXE, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilAxe");
|
||||
MithrilHoe = new ItemHoes(ItemID.MITHRILHOE, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilHoe");
|
||||
AdamantineSword = new ItemSwords(ItemID.ADAMANTINESWORD, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineSword");
|
||||
AdamantinePickaxe = new ItemPickaxes(ItemID.ADAMANTINEPICKAXE, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantinePickaxe");
|
||||
AdamantineShovel = new ItemShovels(ItemID.ADAMANTINESHOVEL, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineShovel");
|
||||
AdamantineAxe = new ItemAxes(ItemID.ADAMANTINEAXE, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineAxe");
|
||||
AdamantineHoe = new ItemHoes(ItemID.ADAMANTINEHOE, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineHoe");
|
||||
IridiumSword = new ItemSwords(ItemID.IRIDIUMSWORD, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumSword");
|
||||
IridiumPickaxe = new ItemPickaxes(ItemID.IRIDIUMPICKAXE, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumPickaxe");
|
||||
IridiumShovel = new ItemShovels(ItemID.IRIDIUMSHOVEL, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumShovel");
|
||||
IridiumAxe = new ItemAxes(ItemID.IRIDIUMAXE, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumAxe");
|
||||
IridiumHoe = new ItemHoes(ItemID.IRIDIUMHOE, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumHoe");
|
||||
BloodstoneSword = new ItemSwords(ItemID.BLOODSTONESWORD, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneSword");
|
||||
BloodstonePickaxe = new ItemPickaxes(ItemID.BLOODSTONEPICKAXE, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstonePickaxe");
|
||||
BloodstoneShovel = new ItemShovels(ItemID.BLOODSTONESHOVEL, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneShovel");
|
||||
BloodstoneAxe = new ItemAxes(ItemID.BLOODSTONEAXE, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneAxe");
|
||||
BloodstoneHoe = new ItemHoes(ItemID.BLOODSTONEHOE, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneHoe");
|
||||
ObsidianSword = new ItemSwords(ItemID.OBSIDIANSWORD, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianSword");
|
||||
ObsidianPickaxe = new ItemPickaxes(ItemID.OBSIDIANPICKAXE, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianPickaxe");
|
||||
ObsidianShovel = new ItemShovels(ItemID.OBSIDIANSHOVEL, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianShovel");
|
||||
ObsidianAxe = new ItemAxes(ItemID.OBSIDIANAXE, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianAxe");
|
||||
ObsidianHoe = new ItemHoes(ItemID.OBSIDIANHOE, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianHoe");
|
||||
Satchel = new ItemSatchel(ItemID.SATCHEL).setUnlocalizedName("Satchel");
|
||||
Resource = new ItemResource().setUnlocalizedName("Resources");
|
||||
VerditeSword = new ItemSword(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeSword");
|
||||
VerditePickaxe = new ItemPick(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditePickaxe");
|
||||
VerditeShovel = new ItemSpade(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeShovel");
|
||||
VerditeAxe = new ItemHatchet(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeAxe");
|
||||
VerditeHoe = new ItemHoe(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeHoe");
|
||||
MithrilSword = new ItemSword(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilSword");
|
||||
MithrilPickaxe = new ItemPick(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilPickaxe");
|
||||
MithrilShovel = new ItemSpade(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilShovel");
|
||||
MithrilAxe = new ItemHatchet(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilAxe");
|
||||
MithrilHoe = new ItemHoe(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilHoe");
|
||||
AdamantineSword = new ItemSword(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineSword");
|
||||
AdamantinePickaxe = new ItemPick(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantinePickaxe");
|
||||
AdamantineShovel = new ItemSpade(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineShovel");
|
||||
AdamantineAxe = new ItemHatchet(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineAxe");
|
||||
AdamantineHoe = new ItemHoe(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineHoe");
|
||||
IridiumSword = new ItemSword(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumSword");
|
||||
IridiumPickaxe = new ItemPick(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumPickaxe");
|
||||
IridiumShovel = new ItemSpade(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumShovel");
|
||||
IridiumAxe = new ItemHatchet(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumAxe");
|
||||
IridiumHoe = new ItemHoe(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumHoe");
|
||||
BloodstoneSword = new ItemSword(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneSword");
|
||||
BloodstonePickaxe = new ItemPick(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstonePickaxe");
|
||||
BloodstoneShovel = new ItemSpade(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneShovel");
|
||||
BloodstoneAxe = new ItemHatchet(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneAxe");
|
||||
BloodstoneHoe = new ItemHoe(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneHoe");
|
||||
ObsidianSword = new ItemSword(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianSword");
|
||||
ObsidianPickaxe = new ItemPick(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianPickaxe");
|
||||
ObsidianShovel = new ItemSpade(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianShovel");
|
||||
ObsidianAxe = new ItemHatchet(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianAxe");
|
||||
ObsidianHoe = new ItemHoe(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianHoe");
|
||||
Satchel = new ItemSatchel().setMaxStackSize(1).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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
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,33 +1,39 @@
|
|||
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.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
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.network.NetworkMod;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
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")
|
||||
@NetworkMod(clientSideRequired = true)
|
||||
public class MysticOres implements IFuelHandler {
|
||||
@Instance("MysticOres")
|
||||
@Mod(modid = "mysticores", name = "Mystic Ores", version = "0.1")
|
||||
public final class MysticOres implements IFuelHandler {
|
||||
@Instance("mysticores")
|
||||
public static MysticOres instance;
|
||||
public static final CreativeTabs MysticOresTab = new TabMysticOres("MysticOresTab");
|
||||
public boolean ENABLE = true;
|
||||
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
|
||||
public int getBurnTime(ItemStack fuel) {
|
||||
if (fuel.getItem().itemID == Items.Resource.itemID && fuel.getItemDamage() == 4)
|
||||
if (fuel.getItem() == Items.Resource && fuel.getItemDamage() == 4)
|
||||
return 12800;
|
||||
else
|
||||
return 0;
|
||||
|
|
@ -36,12 +42,41 @@ public class MysticOres implements IFuelHandler {
|
|||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
ConfigurationManager.initialize(event.getSuggestedConfigurationFile());
|
||||
BlockHandler.initialize();
|
||||
Items.initialize();
|
||||
OreDictManager.initialize();
|
||||
RecipeManager.initialize();
|
||||
GeneratorManager.initialize();
|
||||
Localizations.initialize();
|
||||
GameRegistry.registerFuelHandler(this);
|
||||
if(ENABLE){
|
||||
MysticOresTab = new CreativeTabs("MysticOresTab") {
|
||||
|
||||
@Override
|
||||
public Item getTabIconItem() {
|
||||
return Item.getItemFromBlock(BlockHandler.BlockBase);
|
||||
}
|
||||
|
||||
@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,48 +1,15 @@
|
|||
package mysticores.util;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import mysticores.blocks.BlockHandler;
|
||||
import mysticores.lib.ItemID;
|
||||
import mysticores.MysticOres;
|
||||
import mysticores.lib.Rarity;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ConfigurationManager {
|
||||
public static void initialize(File file) {
|
||||
Configuration config = new Configuration(file);
|
||||
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();
|
||||
MysticOres.instance.ENABLE = config.get("General", "Enable", true).getBoolean();
|
||||
Rarity.VERDITE = config.get("Ore Rarity", "Verdite Ore", Rarity.VERDITE).getInt();
|
||||
Rarity.MITHRIL = config.get("Ore Rarity", "Mithril Ore", Rarity.MITHRIL).getInt();
|
||||
Rarity.ADAMANTINE = config.get("Ore Rarity", "Adamantine Ore", Rarity.ADAMANTINE).getInt();
|
||||
|
|
|
|||
|
|
@ -1,95 +0,0 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
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,16 +1,91 @@
|
|||
package mysticores.util;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import mysticores.MysticOres;
|
||||
import mysticores.blocks.BlockHandler;
|
||||
import mysticores.items.Items;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
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() {
|
||||
recipes();
|
||||
toolRecipes();
|
||||
|
|
@ -19,92 +94,108 @@ public class RecipeManager {
|
|||
}
|
||||
|
||||
private static void powderRecipes() {
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreGold, 2), OreDictManager.INGOTS[9], "oreGold"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreIron, 2), OreDictManager.INGOTS[9], "oreIron"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 2, 10), OreDictManager.INGOTS[9], OreDictManager.INGOTS[10]));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.gunpowder, 2), OreDictManager.INGOTS[9], Item.gunpowder));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 2, 4), OreDictManager.INGOTS[9], OreDictManager.INGOTS[4]));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreCoal, 2), OreDictManager.INGOTS[9], Block.oreCoal));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreIron, 3), OreDictManager.INGOTS[9], "oreIron"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreGold, 3), OreDictManager.INGOTS[9], "oreGold"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreRedstone, 2), OreDictManager.INGOTS[9], "oreRedstone"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreLapis, 2), OreDictManager.INGOTS[9], "oreLapis"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreDiamond, 2), OreDictManager.INGOTS[9], "oreDiamond"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.sugar, 18), OreDictManager.INGOTS[9], Item.sugar));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.redstone, 12), OreDictManager.INGOTS[9], Item.redstone));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.glowstone, 6), OreDictManager.INGOTS[9], Item.glowstone));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.gunpowder, 3), OreDictManager.INGOTS[9], Item.gunpowder));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.gold_ore, 2), MysticOres.INGOTS[9], "oreGold"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.iron_ore, 2), MysticOres.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(net.minecraft.init.Items.gunpowder, 2), MysticOres.INGOTS[9], net.minecraft.init.Items.gunpowder));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 2, 4), MysticOres.INGOTS[9], MysticOres.INGOTS[4]));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.coal_ore, 2), MysticOres.INGOTS[9], "oreCoal"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.iron_ore, 3), MysticOres.INGOTS[9], "oreIron"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.gold_ore, 3), MysticOres.INGOTS[9], "oreGold"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.redstone_ore, 2), MysticOres.INGOTS[9], "oreRedstone"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.lapis_ore, 2), MysticOres.INGOTS[9], "oreLapis"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.diamond_ore, 2), MysticOres.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(net.minecraft.init.Items.redstone, 12), MysticOres.INGOTS[9], net.minecraft.init.Items.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(net.minecraft.init.Items.gunpowder, 3), MysticOres.INGOTS[9], net.minecraft.init.Items.gunpowder));
|
||||
}
|
||||
|
||||
private static void recipes() {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Block.glass, 1), "##", "##", '#', OreDictManager.INGOTS[11]));
|
||||
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", Character.valueOf('X'), Block.dirt, Character.valueOf('O'),
|
||||
OreDictManager.INGOTS[6]));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 16, 7), "XXX", "XOX", "XXX", Character.valueOf('X'), OreDictManager.ORES[3], Character.valueOf('O'),
|
||||
OreDictManager.INGOTS[6]));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 3), "XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'),
|
||||
OreDictManager.INGOTS[8]));
|
||||
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), "##", "##", '#', OreDictManager.INGOTS[10]));
|
||||
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), OreDictManager.INGOTS[9], OreDictManager.ORES[3]));
|
||||
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), "#", "#", '#', OreDictManager.INGOTS[12]));
|
||||
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), Block.glass);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 12), Block.obsidian);
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 8, 9), OreDictManager.INGOTS[5], OreDictManager.INGOTS[7], OreDictManager.INGOTS[8], OreDictManager.INGOTS[6]));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.glass, 1), "##", "##", '#', MysticOres.INGOTS[11]));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.obsidian, 1), "##", "##", '#', MysticOres.INGOTS[12]));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 7), "XXX", "XOX", "XXX", 'X', Blocks.dirt, 'O',
|
||||
MysticOres.INGOTS[6]));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 16, 7), "XXX", "XOX", "XXX", 'X', MysticOres.ORES[3], 'O',
|
||||
MysticOres.INGOTS[6]));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 3), "XXX", "XOX", "XXX", 'X', Blocks.dirt, 'O',
|
||||
MysticOres.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, 1, 7), "##", "##", '#', MysticOres.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, 3), MysticOres.INGOTS[9], MysticOres.ORES[3]));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(BlockHandler.BlockBase, 2, 0), MysticOres.INGOTS[9], MysticOres.ORES[0]));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Resource, 2, 13), "#", "#", '#', MysticOres.INGOTS[12]));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Resource, 1, 3), "###", "#O#", "###", '#', MysticOres.INGOTS[4], 'O', MysticOres.INGOTS[2]));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 11), Blocks.glass);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 12), Blocks.obsidian);
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 8, 9), MysticOres.INGOTS[5], MysticOres.INGOTS[7], MysticOres.INGOTS[8], MysticOres.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() {
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 6, new ItemStack(Items.Resource, 1, 0), 0.4F);
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 3, new ItemStack(Items.Resource, 1, 1), 0.7F);
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 0, new ItemStack(Items.Resource, 1, 2), 0.9F);
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 2, new ItemStack(Items.Resource, 1, 4), 0.4F);
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 4, new ItemStack(Items.Resource, 1, 5), 0.4F);
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 11, new ItemStack(Items.Resource, 1, 6), 0.4F);
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 5, new ItemStack(Items.Resource, 1, 7), 0.4F);
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 1, new ItemStack(Items.Resource, 1, 8), 0.4F);
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 7, new ItemStack(Items.Resource, 1, 10), 0.4F);
|
||||
smeltBlockIntoResource(6, 0, 0.4F);
|
||||
smeltBlockIntoResource(3, 1, 0.7F);
|
||||
smeltBlockIntoResource(0, 2, 0.9F);
|
||||
smeltBlockIntoResource(2, 4, 0.4F);
|
||||
smeltBlockIntoResource(4, 5, 0.4F);
|
||||
smeltBlockIntoResource(11, 6, 0.4F);
|
||||
smeltBlockIntoResource(5, 7, 0.4F);
|
||||
smeltBlockIntoResource(1, 8, 0.4F);
|
||||
smeltBlockIntoResource(7, 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() {
|
||||
ToolRecipes.SwordRecipe(Items.VerditeSword, OreDictManager.INGOTS[0]);
|
||||
ToolRecipes.PickaxeRecipe(Items.VerditePickaxe, OreDictManager.INGOTS[0]);
|
||||
ToolRecipes.ShovelRecipe(Items.VerditeShovel, OreDictManager.INGOTS[0]);
|
||||
ToolRecipes.AxeRecipe(Items.VerditeAxe, OreDictManager.INGOTS[0]);
|
||||
ToolRecipes.HoeRecipe(Items.VerditeHoe, OreDictManager.INGOTS[0]);
|
||||
ToolRecipes.SwordRecipe(Items.MithrilSword, OreDictManager.INGOTS[1]);
|
||||
ToolRecipes.PickaxeRecipe(Items.MithrilPickaxe, OreDictManager.INGOTS[1]);
|
||||
ToolRecipes.ShovelRecipe(Items.MithrilShovel, OreDictManager.INGOTS[1]);
|
||||
ToolRecipes.AxeRecipe(Items.MithrilAxe, OreDictManager.INGOTS[1]);
|
||||
ToolRecipes.HoeRecipe(Items.MithrilHoe, OreDictManager.INGOTS[1]);
|
||||
ToolRecipes.AdvancedSwordRecipe(Items.AdamantineSword, OreDictManager.INGOTS[2]);
|
||||
ToolRecipes.AdvancedPickaxeRecipe(Items.AdamantinePickaxe, OreDictManager.INGOTS[2]);
|
||||
ToolRecipes.AdvancedShovelRecipe(Items.AdamantineShovel, OreDictManager.INGOTS[2]);
|
||||
ToolRecipes.AdvancedAxeRecipe(Items.AdamantineAxe, OreDictManager.INGOTS[2]);
|
||||
ToolRecipes.AdvancedHoeRecipe(Items.AdamantineHoe, OreDictManager.INGOTS[2]);
|
||||
ToolRecipes.AdvancedSwordRecipe(Items.IridiumSword, OreDictManager.INGOTS[3]);
|
||||
ToolRecipes.AdvancedPickaxeRecipe(Items.IridiumPickaxe, OreDictManager.INGOTS[3]);
|
||||
ToolRecipes.AdvancedShovelRecipe(Items.IridiumShovel, OreDictManager.INGOTS[3]);
|
||||
ToolRecipes.AdvancedAxeRecipe(Items.IridiumAxe, OreDictManager.INGOTS[3]);
|
||||
ToolRecipes.AdvancedHoeRecipe(Items.IridiumHoe, OreDictManager.INGOTS[3]);
|
||||
ToolRecipes.AdvancedSwordRecipe(Items.IridiumSword, OreDictManager.INGOTS[3]);
|
||||
ToolRecipes.AdvancedPickaxeRecipe(Items.IridiumPickaxe, OreDictManager.INGOTS[3]);
|
||||
ToolRecipes.AdvancedShovelRecipe(Items.IridiumShovel, OreDictManager.INGOTS[3]);
|
||||
ToolRecipes.AdvancedAxeRecipe(Items.IridiumAxe, OreDictManager.INGOTS[3]);
|
||||
ToolRecipes.AdvancedHoeRecipe(Items.IridiumHoe, OreDictManager.INGOTS[3]);
|
||||
ToolRecipes.AdvancedSwordRecipe(Items.ObsidianSword, new ItemStack(Block.obsidian));
|
||||
ToolRecipes.AdvancedPickaxeRecipe(Items.ObsidianPickaxe, new ItemStack(Block.obsidian));
|
||||
ToolRecipes.AdvancedShovelRecipe(Items.ObsidianShovel, new ItemStack(Block.obsidian));
|
||||
ToolRecipes.AdvancedAxeRecipe(Items.ObsidianAxe, new ItemStack(Block.obsidian));
|
||||
ToolRecipes.AdvancedHoeRecipe(Items.ObsidianHoe, new ItemStack(Block.obsidian));
|
||||
ToolRecipes.AdvancedSwordRecipe(Items.BloodstoneSword, OreDictManager.ORES[7]);
|
||||
ToolRecipes.AdvancedPickaxeRecipe(Items.BloodstonePickaxe, OreDictManager.ORES[7]);
|
||||
ToolRecipes.AdvancedShovelRecipe(Items.BloodstoneShovel, OreDictManager.ORES[7]);
|
||||
ToolRecipes.AdvancedAxeRecipe(Items.BloodstoneAxe, OreDictManager.ORES[7]);
|
||||
ToolRecipes.AdvancedHoeRecipe(Items.BloodstoneHoe, OreDictManager.ORES[7]);
|
||||
GameRegistry.addRecipe(new ItemStack(Items.Satchel, 1), "#$#", "$%$", "#$#", '#', Item.silk, '$', OreDictManager.INGOTS[9], '%', Block.enderChest);
|
||||
ToolRecipes.sword(Items.VerditeSword, MysticOres.INGOTS[0]);
|
||||
ToolRecipes.pickaxe(Items.VerditePickaxe, MysticOres.INGOTS[0]);
|
||||
ToolRecipes.shovel(Items.VerditeShovel, MysticOres.INGOTS[0]);
|
||||
ToolRecipes.axe(Items.VerditeAxe, MysticOres.INGOTS[0]);
|
||||
ToolRecipes.hoe(Items.VerditeHoe, MysticOres.INGOTS[0]);
|
||||
ToolRecipes.sword(Items.MithrilSword, MysticOres.INGOTS[1]);
|
||||
ToolRecipes.pickaxe(Items.MithrilPickaxe, MysticOres.INGOTS[1]);
|
||||
ToolRecipes.shovel(Items.MithrilShovel, MysticOres.INGOTS[1]);
|
||||
ToolRecipes.axe(Items.MithrilAxe, MysticOres.INGOTS[1]);
|
||||
ToolRecipes.hoe(Items.MithrilHoe, MysticOres.INGOTS[1]);
|
||||
ToolRecipes.advancedSword(Items.AdamantineSword, MysticOres.INGOTS[2]);
|
||||
ToolRecipes.advancedPickaxe(Items.AdamantinePickaxe, MysticOres.INGOTS[2]);
|
||||
ToolRecipes.advancedShovel(Items.AdamantineShovel, MysticOres.INGOTS[2]);
|
||||
ToolRecipes.advancedAxe(Items.AdamantineAxe, MysticOres.INGOTS[2]);
|
||||
ToolRecipes.advancedHoe(Items.AdamantineHoe, MysticOres.INGOTS[2]);
|
||||
ToolRecipes.advancedSword(Items.IridiumSword, MysticOres.INGOTS[3]);
|
||||
ToolRecipes.advancedPickaxe(Items.IridiumPickaxe, MysticOres.INGOTS[3]);
|
||||
ToolRecipes.advancedShovel(Items.IridiumShovel, MysticOres.INGOTS[3]);
|
||||
ToolRecipes.advancedAxe(Items.IridiumAxe, MysticOres.INGOTS[3]);
|
||||
ToolRecipes.advancedHoe(Items.IridiumHoe, MysticOres.INGOTS[3]);
|
||||
ToolRecipes.advancedSword(Items.IridiumSword, MysticOres.INGOTS[3]);
|
||||
ToolRecipes.advancedPickaxe(Items.IridiumPickaxe, MysticOres.INGOTS[3]);
|
||||
ToolRecipes.advancedShovel(Items.IridiumShovel, MysticOres.INGOTS[3]);
|
||||
ToolRecipes.advancedAxe(Items.IridiumAxe, MysticOres.INGOTS[3]);
|
||||
ToolRecipes.advancedHoe(Items.IridiumHoe, MysticOres.INGOTS[3]);
|
||||
ToolRecipes.advancedSword(Items.ObsidianSword, new ItemStack(Blocks.obsidian));
|
||||
ToolRecipes.advancedPickaxe(Items.ObsidianPickaxe, new ItemStack(Blocks.obsidian));
|
||||
ToolRecipes.advancedShovel(Items.ObsidianShovel, new ItemStack(Blocks.obsidian));
|
||||
ToolRecipes.advancedAxe(Items.ObsidianAxe, new ItemStack(Blocks.obsidian));
|
||||
ToolRecipes.advancedHoe(Items.ObsidianHoe, new ItemStack(Blocks.obsidian));
|
||||
ToolRecipes.advancedSword(Items.BloodstoneSword, MysticOres.ORES[7]);
|
||||
ToolRecipes.advancedPickaxe(Items.BloodstonePickaxe, MysticOres.ORES[7]);
|
||||
ToolRecipes.advancedShovel(Items.BloodstoneShovel, MysticOres.ORES[7]);
|
||||
ToolRecipes.advancedAxe(Items.BloodstoneAxe, MysticOres.ORES[7]);
|
||||
ToolRecipes.advancedHoe(Items.BloodstoneHoe, MysticOres.ORES[7]);
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Satchel, 1), "#$#", "$%$", "#$#", '#', net.minecraft.init.Items.string, '$', MysticOres.INGOTS[9], '%', Blocks.ender_chest));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
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,52 +1,53 @@
|
|||
package mysticores.util;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import mysticores.MysticOres;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ToolRecipes {
|
||||
public static void AdvancedAxeRecipe(Item output, Object 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', OreDictManager.INGOTS[13], '#', input));
|
||||
public static void advancedAxe(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', MysticOres.INGOTS[13], '#', input));
|
||||
}
|
||||
|
||||
public static void AdvancedHoeRecipe(Item output, Object 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', OreDictManager.INGOTS[13], '#', input));
|
||||
public static void advancedHoe(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', MysticOres.INGOTS[13], '#', input));
|
||||
}
|
||||
|
||||
public static void AdvancedPickaxeRecipe(Item output, Object input) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "###", " S ", " S ", 'S', OreDictManager.INGOTS[13], '#', input));
|
||||
public static void advancedPickaxe(Item output, Object input) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "###", " S ", " S ", 'S', MysticOres.INGOTS[13], '#', input));
|
||||
}
|
||||
|
||||
public static void AdvancedShovelRecipe(Item output, Object input) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "S", "S", 'S', OreDictManager.INGOTS[13], '#', input));
|
||||
public static void advancedShovel(Item output, Object input) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "S", "S", 'S', MysticOres.INGOTS[13], '#', input));
|
||||
}
|
||||
|
||||
public static void AdvancedSwordRecipe(Item output, Object input) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "#", "S", 'S', OreDictManager.INGOTS[13], '#', input));
|
||||
public static void advancedSword(Item output, Object input) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "#", "S", 'S', MysticOres.INGOTS[13], '#', input));
|
||||
}
|
||||
|
||||
public static void AxeRecipe(Item output, Object input) {
|
||||
public static void axe(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 HoeRecipe(Item output, Object input) {
|
||||
public static void hoe(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 PickaxeRecipe(Item output, Object input) {
|
||||
public static void pickaxe(Item output, Object input) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "###", " S ", " S ", 'S', "stickWood", '#', input));
|
||||
}
|
||||
|
||||
public static void ShovelRecipe(Item output, Object input) {
|
||||
public static void shovel(Item output, Object input) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "S", "S", 'S', "stickWood", '#', input));
|
||||
}
|
||||
|
||||
public static void SwordRecipe(Item output, Object input) {
|
||||
public static void sword(Item output, Object input) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(output), "#", "#", "S", 'S', "stickWood", '#', input));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
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,23 +1,24 @@
|
|||
package mysticores.worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class NetherGenHelper extends WorldGenerator {
|
||||
private int minableBlockId;
|
||||
private Block minableBlockId;
|
||||
private int minableBlockMeta = 0;
|
||||
private int numberOfBlocks;
|
||||
|
||||
public NetherGenHelper(int par1, int par2) {
|
||||
public NetherGenHelper(Block par1, int par2) {
|
||||
this.minableBlockId = par1;
|
||||
this.numberOfBlocks = par2;
|
||||
}
|
||||
|
||||
public NetherGenHelper(int id, int meta, int number) {
|
||||
public NetherGenHelper(Block id, int meta, int number) {
|
||||
this(id, number);
|
||||
minableBlockMeta = meta;
|
||||
}
|
||||
|
|
@ -52,8 +53,8 @@ public class NetherGenHelper extends WorldGenerator {
|
|||
if (var39 * var39 + var42 * var42 < 1.0D) {
|
||||
for (int var44 = var34; var44 <= var37; ++var44) {
|
||||
double var45 = (var44 + 0.5D - var24) / (var28 / 2.0D);
|
||||
int blocktoreplace = par1World.getBlockId(var38, var41, var44);
|
||||
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && blocktoreplace == Block.netherrack.blockID) {
|
||||
Block blocktoreplace = par1World.getBlock(var38, var41, var44);
|
||||
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && blocktoreplace == Blocks.netherrack) {
|
||||
par1World.setBlock(var38, var41, var44, this.minableBlockId, minableBlockMeta, 3);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
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,37 +1,175 @@
|
|||
package mysticruins;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
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 net.minecraftforge.common.Configuration;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
public class Config {
|
||||
public static Configuration config;
|
||||
public static int RuinRarity;
|
||||
public static int DunRarity;
|
||||
public static List<Integer> ruinAllowId = new ArrayList();
|
||||
public static List<Integer> dungeonAllowId = new ArrayList();
|
||||
public static Set<Integer>[] allowId = new HashSet[4];
|
||||
public static final String[] allows = { "Ruin allowed dimension id", "Dungeon allowed dimension id", "Ruin allowed biome id", "Dungeon allowed biome id" };
|
||||
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) {
|
||||
config = new Configuration(file);
|
||||
config.load();
|
||||
RuinRarity = config.get("General", "Ruin Rarity", 2).getInt();
|
||||
DunRarity = config.get("General", "Mystic Dungeon Rarity", 1).getInt();
|
||||
String[] ID = config.get("General", "Ruin allowed dimension id", "0,").getString().split(",");
|
||||
for (String txt : ID) {
|
||||
try {
|
||||
ruinAllowId.add(Integer.parseInt(txt.trim()));
|
||||
} catch (NumberFormatException e) {
|
||||
MysticRuins.ENABLE = config.get("General", "Enable", true).getBoolean(true);
|
||||
String[] mobs = config.get("DungeonMobs", "Spawner Type & Relative Chance", "Skeleton-50,Spider-50,Zombie-20,Cavepider-10,Blaze-1", "MobName-RelativeWeight").getString().split(",");
|
||||
String[] mob;
|
||||
for (String txt : mobs) {
|
||||
mob = txt.split("-");
|
||||
if (mob.length == 2) {
|
||||
try {
|
||||
addDungeonMob(mob[0].trim(), Integer.parseInt(mob[1].trim()));
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
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) {
|
||||
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 {
|
||||
switch (item.length) {
|
||||
case 3:
|
||||
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));
|
||||
}
|
||||
}
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
|
|
@ -5,11 +5,13 @@ import cpw.mods.fml.common.Mod.EventHandler;
|
|||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
@Mod(modid = "MysticRuins", name = "Mystic Ruins", version = "0.1")
|
||||
public class MysticRuins {
|
||||
@Mod(modid = "mysticruins", name = "Mystic Ruins", version = "0.1")
|
||||
public final class MysticRuins {
|
||||
public static boolean ENABLE = true;
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
Config.initialize(event.getSuggestedConfigurationFile());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMystic());
|
||||
if(ENABLE)
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMystic(), 20);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,435 +1,431 @@
|
|||
package mysticruins;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.common.DungeonHooks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class StructureRuin$1 extends WorldGenerator {
|
||||
public StructureRuin$1() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(World world, Random random, int i, int j, int k) {
|
||||
int l = random.nextInt(100);
|
||||
if (l >= 10) {
|
||||
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
|
||||
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
|
||||
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
|
||||
if (k1 <= 0) {
|
||||
return false;
|
||||
}
|
||||
for (int i1 = 0; i1 < 1; i1++) {
|
||||
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
|
||||
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
|
||||
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
|
||||
if (!world.isAirBlock(j1, k1, l1) || world.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || !Block.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) {
|
||||
continue;
|
||||
}
|
||||
int i2 = random.nextInt(3) + 1;
|
||||
if (i2 == 1) {
|
||||
int j2 = random.nextInt(8) + 5;
|
||||
int i3 = random.nextInt(8) + 5;
|
||||
int l3 = random.nextInt(8) + 5;
|
||||
int k4 = random.nextInt(4) + 3;
|
||||
int j5 = 1;
|
||||
int i6 = 0;
|
||||
int l6 = 1;
|
||||
boolean flag = false;
|
||||
int k7 = random.nextInt(100);
|
||||
int j8 = random.nextInt(100);
|
||||
if (j8 <= 20) {
|
||||
j5 = 0;
|
||||
} else {
|
||||
j5 = random.nextInt(4) + 5;
|
||||
}
|
||||
world.setBlock(j1, k1 - j5, l1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 1, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 3, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 4, l1 + 1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 5, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 3, l1 + 2, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 4, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, k1 - j5, l1 + 3, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 1, l1 + 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, k1 - j5 - k4 - 1, l1 + 2, Block.dirt.blockID);
|
||||
world.setBlock(j1, k1 - j5 - k4, l1 + 2, Block.chest.blockID);
|
||||
ChestFiller.fillWithValuables(world.getBlockTileEntity(j1, k1 - j5 - k4, l1 + 2));
|
||||
l6 = 1;
|
||||
i6 = 0;
|
||||
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.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);
|
||||
}
|
||||
}
|
||||
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 {
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (i2 != 3) {
|
||||
continue;
|
||||
}
|
||||
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 = 1;
|
||||
int k6 = 0;
|
||||
int j7 = 1;
|
||||
boolean flag2 = false;
|
||||
int i8 = random.nextInt(100);
|
||||
int l8 = random.nextInt(100);
|
||||
if (l8 <= 20) {
|
||||
l5 = 0;
|
||||
if (!world.isAirBlock(j1, k1, l1) || world.getBlock(j1, k1 - 1, l1) != Blocks.grass || !Blocks.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) {
|
||||
return false;
|
||||
}
|
||||
int i2 = random.nextInt(3) + 1;
|
||||
if (i2 == 1) {
|
||||
int i3 = random.nextInt(8) + 5;
|
||||
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 {
|
||||
l5 = random.nextInt(4) + 5;
|
||||
j5 = random.nextInt(4) + 5;
|
||||
}
|
||||
world.setBlock(j1, k1 - l5, l1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 1, k1 - l5, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 1, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 2, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 3, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - l5) + 1, l1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 2, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - l5) + 3, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - l5) + 4, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - l5) + 5, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, k1 - l5, l1 + 1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 2, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, k1 - l5, l1 + 2, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 1, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, k1 - l5 - i5, l1 + 1, Block.dirt.blockID);
|
||||
world.setBlock(j1, k1 - l5 - i5 - 1, l1 + 1, Block.dirt.blockID);
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
setBlock(world, j1, k1 - j5, l1, Blocks.stonebrick);
|
||||
setBlock(world, j1, (k1 - j5) + 2, l1, Blocks.stonebrick);
|
||||
setBlock(world, j1, (k1 - j5) + 4, l1 + 1, Blocks.stonebrick);
|
||||
setBlock(world, j1, (k1 - j5) + 3, l1 + 2, Blocks.stonebrick);
|
||||
setBlock(world, j1, (k1 - j5) + 1, l1 + 3, Blocks.stonebrick);
|
||||
setBlock(world, j1, (k1 - j5) + 2, l1 + 3, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1, k1 - j5, l1 + 3, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, (k1 - j5) + 1, l1, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, (k1 - j5) + 2, l1 + 1, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, (k1 - j5) + 3, l1 + 1, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, (k1 - j5) + 5, l1 + 1, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, (k1 - j5) + 2, l1 + 2, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, (k1 - j5) + 4, l1 + 2, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1, k1 - j5 - k4 - 1, l1 + 2, Blocks.dirt);
|
||||
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 + 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.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Block.waterStill.blockID
|
||||
|| world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Block.waterStill.blockID
|
||||
|| world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Block.waterStill.blockID) {
|
||||
k6++;
|
||||
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 {
|
||||
flag2 = true;
|
||||
flag = true;
|
||||
}
|
||||
} while (!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2 + 3, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 3) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 2, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 3, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 6, Block.stoneBrick.blockID);
|
||||
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);
|
||||
} while (!flag && l6++ < 12);
|
||||
setBlock(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick);
|
||||
setBlock(world, j1 + l3 + 2, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick);
|
||||
setBlock(world, j1 + l3 + 5, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick);
|
||||
setBlock(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 5, Blocks.stonebrick);
|
||||
setBlock(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 7, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + l3 + 1, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + l3 + 1, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + l3 + 3, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + l3 + 4, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 5, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 6, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 3) - i6, l1 + l3 + 6, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 7, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 7, Blocks.stonebrick, 1);
|
||||
int k7 = random.nextInt(100);
|
||||
if (k7 <= 30) {
|
||||
setBlock(world, j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Blocks.mob_spawner);
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5);
|
||||
if (spawner != null) {
|
||||
spawner.func_145881_a().setEntityName(DungeonHooks.getRandomDungeonMob(random));
|
||||
}
|
||||
setBlock(world, j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Blocks.dirt);
|
||||
}
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
l6 = 1;
|
||||
i6 = 0;
|
||||
flag = 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.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.getBlockId(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Block.waterStill.blockID) {
|
||||
k6++;
|
||||
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.getBlock(j1 - i3, k1 - j5 - l6, l1 - 4) == Blocks.water || world.getBlock(j1 - i3, k1 - j5 - l6, l1 - 5) == Blocks.water
|
||||
|| world.getBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Blocks.water) {
|
||||
i6++;
|
||||
} else {
|
||||
flag2 = true;
|
||||
flag = true;
|
||||
}
|
||||
} while (!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k3, (k1 - l5 - k6) + 1, l1 - l2 - 1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k3, (k1 - l5 - k6) + 2, l1 - l2 - 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 3, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3 - 2, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k3 - 2, ((k1 - l5) + 1) - k6, l1 - l2 - 6, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k3 - 3, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID);
|
||||
i8 = random.nextInt(100);
|
||||
if (i8 <= 60) {
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Block.dirt.blockID);
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, 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);
|
||||
}
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
}
|
||||
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 k8 = random.nextInt(100);
|
||||
int k5;
|
||||
if (k8 <= 20) {
|
||||
k5 = 0;
|
||||
} else {
|
||||
k5 = random.nextInt(4) + 5;
|
||||
}
|
||||
setBlock(world, j1, k1 - k5, l1, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1, k1 - k5, l1 + 1, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, k1 - k5, l1 + 2, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, k1 - k5, l1 + 3, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, k1 - k5, l1 + 4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, (k1 - k5) + 1, l1 + 2, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, (k1 - k5) + 2, l1 + 2, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, (k1 - k5) + 3, l1 + 2, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1, (k1 - k5) + 1, l1 + 1, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + 1, k1 - k5, l1, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + 2, k1 - k5, l1, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1, k1 - k5 - l4, l1 + 2, Blocks.dirt);
|
||||
setBlock(world, j1, k1 - k5 - l4 - 1, l1 + 2, Blocks.dirt);
|
||||
int i7 = 1;
|
||||
int j6 = 0;
|
||||
boolean flag1 = 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.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.getBlockId(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID) {
|
||||
k6++;
|
||||
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.getBlock(j1 - k2, k1 - k5 - i7, l1 - 4) == Blocks.water || world.getBlock(j1 - k2, k1 - k5 - i7, l1 - 5) == Blocks.water
|
||||
|| world.getBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Blocks.water) {
|
||||
j6++;
|
||||
} else {
|
||||
flag2 = true;
|
||||
flag1 = true;
|
||||
}
|
||||
} while (!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 + l2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 3) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 3, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l2 + 4, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 4, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 5, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
i8 = random.nextInt(100);
|
||||
if (i8 <= 30) {
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Block.dirt.blockID);
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Block.dirt.blockID);
|
||||
} while (!flag1 && i7++ < 12);
|
||||
setBlock(world, j1 - k2, k1 - k5 - j6, l1 - 3, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 - k2, k1 - k5 - j6, l1 - 4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 1) - j6, l1 - 4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 2) - j6, l1 - 4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 - k2, k1 - k5 - j6, l1 - 5, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 1) - j6, l1 - 5, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 2) - j6, l1 - 5, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 3) - j6, l1 - 5, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 4) - j6, l1 - 5, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 - k2 - 1, k1 - k5 - j6, l1 - 5, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 - k2 - 1, ((k1 - k5) + 1) - j6, l1 - 5, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 - k2 - 1, ((k1 - k5) + 2) - j6, l1 - 5, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 - k2 - 2, k1 - k5 - j6, l1 - 5, Blocks.stonebrick);
|
||||
int l7 = random.nextInt(100);
|
||||
if (l7 <= 30) {
|
||||
setBlock(world, j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Blocks.dirt);
|
||||
setBlock(world, j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Blocks.dirt);
|
||||
}
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
i7 = 1;
|
||||
j6 = 0;
|
||||
flag1 = 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.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.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Block.waterStill.blockID) {
|
||||
k6++;
|
||||
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.getBlock(j1 + i4, k1 - k5 - i7, l1 + 4) == Blocks.water || world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 6) == Blocks.water
|
||||
|| world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 8) == Blocks.water) {
|
||||
j6++;
|
||||
} else {
|
||||
flag2 = true;
|
||||
flag1 = true;
|
||||
}
|
||||
} while (!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 2, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 5, Block.stoneBrick.blockID, 1, 2);
|
||||
i8 = random.nextInt(100);
|
||||
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));
|
||||
} while (!flag1 && i7++ < 12);
|
||||
setBlock(world, j1 + i4, k1 - k5 - j6, l1 + 4, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + i4 + 1, k1 - k5 - j6, l1 + 4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + i4 + 1, ((k1 - k5) + 1) - j6, l1 + 4, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 + i4 + 2, k1 - k5 - j6, l1 + 4, Blocks.stonebrick);
|
||||
setBlock(world, j1 + i4 + 3, k1 - k5 - j6, l1 + 4, Blocks.stonebrick);
|
||||
setBlock(world, j1 + i4 + 3, ((k1 - k5) + 1) - j6, l1 + 4, Blocks.stonebrick);
|
||||
setBlock(world, j1 + i4 + 4, k1 - k5 - j6, l1 + 4, Blocks.stonebrick);
|
||||
setBlock(world, j1 + i4 + 5, k1 - k5 - j6, l1 + 4, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 + i4, k1 - k5 - j6, l1 + 5, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 5, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 2) - j6, l1 + 6, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + i4, k1 - k5 - j6, l1 + 7, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 7, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 2) - j6, l1 + 7, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 + i4, k1 - k5 - j6, l1 + 8, Blocks.stonebrick);
|
||||
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;
|
||||
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.getBlock(j1 - j3, k1 - k5 - i7, l1 + i4) == Blocks.water || world.getBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Blocks.water
|
||||
|| world.getBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Blocks.water) {
|
||||
j6++;
|
||||
} else {
|
||||
flag1 = true;
|
||||
}
|
||||
} while (!flag1 && i7++ < 12);
|
||||
setBlock(world, (j1 - j3) + 1, k1 - k5 - j6, l1 + i4, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, (j1 - j3) + 1, ((k1 - k5) + 1) - j6, l1 + i4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, (j1 - j3) + 1, ((k1 - k5) + 2) - j6, l1 + i4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, (j1 - j3) + 2, k1 - k5 - j6, l1 + i4, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 - j3, k1 - k5 - j6, (l1 + i4) - 1, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 1, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 1, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 1, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 1, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 2, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 2, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 2, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 5) - j6, (l1 + i4) - 2, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 - j3, k1 - k5 - j6, (l1 + i4) - 3, Blocks.stonebrick);
|
||||
setBlock(world, j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 3, Blocks.stonebrick);
|
||||
setBlock(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 3, Blocks.stonebrick);
|
||||
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;
|
||||
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.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Blocks.water || world.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Blocks.water
|
||||
|| world.getBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Blocks.water) {
|
||||
j6++;
|
||||
} else {
|
||||
flag1 = true;
|
||||
}
|
||||
} while (!flag1 && i7++ < 12);
|
||||
setBlock(world, j1 + j3 + 4, k1 - k5 - j6, l1 - 6, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 6, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 2) - j6, l1 - 6, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + j3 + 4, k1 - k5 - j6, l1 - 7, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 7, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 + j3 + 5, k1 - k5 - j6, l1 - 7, Blocks.stonebrick);
|
||||
setBlockAndMetadata(world, j1 + j3 + 5, ((k1 - k5) + 1) - j6, l1 - 7, Blocks.stonebrick, 1);
|
||||
setBlockAndMetadata(world, j1 + j3 + 5, ((k1 - k5) + 2) - j6, l1 - 7, Blocks.stonebrick, 1);
|
||||
setBlock(world, j1 + j3 + 6, k1 - k5 - j6, l1 - 7, Blocks.stonebrick);
|
||||
l7 = random.nextInt(100);
|
||||
if (l7 <= 30) {
|
||||
setBlock(world, j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Blocks.dirt);
|
||||
setBlock(world, j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Blocks.dirt);
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
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,434 +1,432 @@
|
|||
package mysticruins;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.common.DungeonHooks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class StructureRuin extends WorldGenerator {
|
||||
public StructureRuin() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(World world, Random random, int i, int j, int k) {
|
||||
int l = random.nextInt(100);
|
||||
if (l >= 10) {
|
||||
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
|
||||
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
|
||||
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
|
||||
if (k1 <= 0) {
|
||||
return false;
|
||||
}
|
||||
for (int i1 = 0; i1 < 1; i1++) {
|
||||
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
|
||||
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
|
||||
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
|
||||
if (!world.isAirBlock(j1, k1, l1) || world.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || !Block.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) {
|
||||
continue;
|
||||
}
|
||||
int i2 = random.nextInt(3) + 1;
|
||||
if (i2 == 1) {
|
||||
int j2 = random.nextInt(8) + 5;
|
||||
int i3 = random.nextInt(8) + 5;
|
||||
int l3 = random.nextInt(8) + 5;
|
||||
int k4 = random.nextInt(4) + 3;
|
||||
int j5 = 1;
|
||||
int i6 = 0;
|
||||
int l6 = 1;
|
||||
boolean flag = false;
|
||||
int k7 = random.nextInt(100);
|
||||
int j8 = random.nextInt(100);
|
||||
if (j8 <= 20) {
|
||||
j5 = 0;
|
||||
} else {
|
||||
j5 = random.nextInt(4) + 5;
|
||||
}
|
||||
world.setBlock(j1, k1 - j5, l1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 1, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 3, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 4, l1 + 1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 5, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 3, l1 + 2, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 4, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, k1 - j5, l1 + 3, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 1, l1 + 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, k1 - j5 - k4 - 1, l1 + 2, Block.dirt.blockID);
|
||||
world.setBlock(j1, k1 - j5 - k4, l1 + 2, Block.chest.blockID);
|
||||
ChestFiller.fillWithValuables(world.getBlockTileEntity(j1, k1 - j5 - k4, l1 + 2));
|
||||
l6 = 1;
|
||||
i6 = 0;
|
||||
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.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);
|
||||
}
|
||||
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.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 {
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (i2 != 3) {
|
||||
continue;
|
||||
}
|
||||
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 = 1;
|
||||
int k6 = 0;
|
||||
int j7 = 1;
|
||||
boolean flag2 = false;
|
||||
int i8 = random.nextInt(100);
|
||||
int l8 = random.nextInt(100);
|
||||
if (l8 <= 20) {
|
||||
l5 = 0;
|
||||
if (!world.isAirBlock(j1, k1, l1) || world.getBlock(j1, k1 - 1, l1) != Blocks.grass || !Blocks.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) {
|
||||
return false;
|
||||
}
|
||||
int i2 = random.nextInt(3) + 1;
|
||||
if (i2 == 1) {
|
||||
int i3 = random.nextInt(8) + 5;
|
||||
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 {
|
||||
l5 = random.nextInt(4) + 5;
|
||||
j5 = random.nextInt(4) + 5;
|
||||
}
|
||||
world.setBlock(j1, k1 - l5, l1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 1, k1 - l5, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 1, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 2, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 3, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 1, l1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 2, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 3, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 4, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 5, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, k1 - l5, l1 + 1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 2, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, k1 - l5, l1 + 2, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 1, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, k1 - l5 - i5, l1 + 1, Block.dirt.blockID);
|
||||
world.setBlock(j1, k1 - l5 - i5 - 1, l1 + 1, Block.dirt.blockID);
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
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.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Block.waterStill.blockID
|
||||
|| world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Block.waterStill.blockID
|
||||
|| world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Block.waterStill.blockID) {
|
||||
k6++;
|
||||
} else {
|
||||
flag2 = true;
|
||||
for (int y = k1 - j5; y < k1 - j5 + 5; y++) {
|
||||
if (y < k1 - j5 + 3) {
|
||||
setBlock(world,j1, y, l1, pickBlock(random));
|
||||
setBlock(world,j1, y, l1 + 3, pickBlock(random));
|
||||
}
|
||||
} while (!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2 + 3, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 3) - k6, l1 + j4 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 2, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 3, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 6, Block.cobblestone.blockID);
|
||||
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);
|
||||
}
|
||||
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.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.getBlockId(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Block.waterStill.blockID) {
|
||||
k6++;
|
||||
} else {
|
||||
flag2 = true;
|
||||
if (y > k1 - j5 + 1) {
|
||||
setBlock(world,j1, y, l1 + 1, pickBlock(random));
|
||||
setBlock(world,j1, y, l1 + 2, pickBlock(random));
|
||||
}
|
||||
} while (!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k3, (k1 - l5 - k6) + 1, l1 - l2 - 1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k3, (k1 - l5 - k6) + 2, l1 - l2 - 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 3, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6, l1 - l2 - 6, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3 - 2, k1 - l5 - k6, l1 - l2 - 6, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k3 - 2, ((k1 - l5) + 1) - k6, l1 - l2 - 6, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k3 - 3, k1 - l5 - k6, l1 - l2 - 6, Block.cobblestone.blockID);
|
||||
i8 = random.nextInt(100);
|
||||
if (i8 <= 60) {
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Block.dirt.blockID);
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, Block.dirt.blockID);
|
||||
}
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
setBlock(world,j1, (k1 - j5) + 5, l1 + 1, pickBlock(random));
|
||||
setBlock(world,j1, k1 - j5 - k4 - 1, l1 + 2, Blocks.dirt);
|
||||
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 + 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.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.getBlockId(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID) {
|
||||
k6++;
|
||||
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 {
|
||||
flag2 = true;
|
||||
flag = true;
|
||||
}
|
||||
} while (!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 + l2, k1 - l5 - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 2) - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 3) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 2) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 3, ((k1 - l5) + 2) - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l2 + 4, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 4, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 5, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
i8 = random.nextInt(100);
|
||||
if (i8 <= 30) {
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Block.dirt.blockID);
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Block.dirt.blockID);
|
||||
} while (!flag && l6++ < 12);
|
||||
setBlock(world,j1 + l3, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + l3 + 1, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + l3 + 1, ((k1 - j5) + 1) - i6, l1 + l3 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + l3 + 2, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + l3 + 3, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + l3 + 4, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + l3 + 5, k1 - j5 - i6, l1 + l3 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + l3, k1 - j5 - i6, l1 + l3 + 5, pickBlock(random));
|
||||
setBlock(world,j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 5, pickBlock(random));
|
||||
setBlock(world,j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 6, pickBlock(random));
|
||||
setBlock(world,j1 + l3, ((k1 - j5) + 3) - i6, l1 + l3 + 6, pickBlock(random));
|
||||
setBlock(world,j1 + l3, k1 - j5 - i6, l1 + l3 + 7, pickBlock(random));
|
||||
setBlock(world,j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 7, pickBlock(random));
|
||||
setBlock(world,j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 7, pickBlock(random));
|
||||
int k7 = random.nextInt(100);
|
||||
if (k7 <= 30) {
|
||||
setBlock(world,j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Blocks.mob_spawner);
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5);
|
||||
if (spawner != null) {
|
||||
spawner.func_145881_a().setEntityName(DungeonHooks.getRandomDungeonMob(random));
|
||||
}
|
||||
setBlock(world,j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Blocks.dirt);
|
||||
}
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
l6 = 1;
|
||||
i6 = 0;
|
||||
flag = 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.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.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Block.waterStill.blockID) {
|
||||
k6++;
|
||||
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.getBlock(j1 - i3, k1 - j5 - l6, l1 - 4) == Blocks.water || world.getBlock(j1 - i3, k1 - j5 - l6, l1 - 5) == Blocks.water
|
||||
|| world.getBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Blocks.water) {
|
||||
i6++;
|
||||
} else {
|
||||
flag2 = true;
|
||||
flag = true;
|
||||
}
|
||||
} while (!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 2, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 5, Block.cobblestoneMossy.blockID);
|
||||
i8 = random.nextInt(100);
|
||||
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));
|
||||
} 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) {
|
||||
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;
|
||||
int k8 = random.nextInt(100);
|
||||
if (k8 <= 20) {
|
||||
k5 = 0;
|
||||
} else {
|
||||
k5 = random.nextInt(4) + 5;
|
||||
}
|
||||
setBlock(world,j1, k1 - k5, l1, pickBlock(random));
|
||||
setBlock(world,j1, k1 - k5, l1 + 1, pickBlock(random));
|
||||
setBlock(world,j1, k1 - k5, l1 + 2, pickBlock(random));
|
||||
setBlock(world,j1, k1 - k5, l1 + 3, pickBlock(random));
|
||||
setBlock(world,j1, k1 - k5, l1 + 4, pickBlock(random));
|
||||
setBlock(world,j1, (k1 - k5) + 1, l1 + 2, pickBlock(random));
|
||||
setBlock(world,j1, (k1 - k5) + 2, l1 + 2, pickBlock(random));
|
||||
setBlock(world,j1, (k1 - k5) + 3, l1 + 2, pickBlock(random));
|
||||
setBlock(world,j1, (k1 - k5) + 1, l1 + 1, pickBlock(random));
|
||||
setBlock(world,j1 + 1, k1 - k5, l1, pickBlock(random));
|
||||
setBlock(world,j1 + 2, k1 - k5, l1, pickBlock(random));
|
||||
setBlock(world,j1, k1 - k5 - l4, l1 + 2, Blocks.dirt);
|
||||
setBlock(world,j1, k1 - k5 - l4 - 1, l1 + 2, Blocks.dirt);
|
||||
int i7 = 1;
|
||||
int j6 = 0;
|
||||
boolean 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.getBlock(j1 - k2, k1 - k5 - i7, l1 - 4) == Blocks.water || world.getBlock(j1 - k2, k1 - k5 - i7, l1 - 5) == Blocks.water
|
||||
|| world.getBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Blocks.water) {
|
||||
j6++;
|
||||
} else {
|
||||
flag1 = true;
|
||||
}
|
||||
} while (!flag1 && i7++ < 12);
|
||||
setBlock(world,j1 - k2, k1 - k5 - j6, l1 - 3, pickBlock(random));
|
||||
setBlock(world,j1 - k2, k1 - k5 - j6, l1 - 4, pickBlock(random));
|
||||
setBlock(world,j1 - k2, ((k1 - k5) + 1) - j6, l1 - 4, pickBlock(random));
|
||||
setBlock(world,j1 - k2, ((k1 - k5) + 2) - j6, l1 - 4, pickBlock(random));
|
||||
setBlock(world,j1 - k2, k1 - k5 - j6, l1 - 5, pickBlock(random));
|
||||
setBlock(world,j1 - k2, ((k1 - k5) + 1) - j6, l1 - 5, pickBlock(random));
|
||||
setBlock(world,j1 - k2, ((k1 - k5) + 2) - j6, l1 - 5, pickBlock(random));
|
||||
setBlock(world,j1 - k2, ((k1 - k5) + 3) - j6, l1 - 5, pickBlock(random));
|
||||
setBlock(world,j1 - k2, ((k1 - k5) + 4) - j6, l1 - 5, pickBlock(random));
|
||||
setBlock(world,j1 - k2 - 1, k1 - k5 - j6, l1 - 5, pickBlock(random));
|
||||
setBlock(world,j1 - k2 - 1, ((k1 - k5) + 1) - j6, l1 - 5, pickBlock(random));
|
||||
setBlock(world,j1 - k2 - 1, ((k1 - k5) + 2) - j6, l1 - 5, pickBlock(random));
|
||||
setBlock(world,j1 - k2 - 2, k1 - k5 - j6, l1 - 5, pickBlock(random));
|
||||
int l7 = random.nextInt(100);
|
||||
if (l7 <= 30) {
|
||||
setBlock(world,j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Blocks.dirt);
|
||||
setBlock(world,j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Blocks.dirt);
|
||||
}
|
||||
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.getBlock(j1 + i4, k1 - k5 - i7, l1 + 4) == Blocks.water || world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 6) == Blocks.water
|
||||
|| world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 8) == Blocks.water) {
|
||||
j6++;
|
||||
} else {
|
||||
flag1 = true;
|
||||
}
|
||||
} while (!flag1 && i7++ < 12);
|
||||
setBlock(world,j1 + i4, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + i4, ((k1 - k5) + 1) - j6, l1 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + i4 + 1, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + i4 + 1, ((k1 - k5) + 1) - j6, l1 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + i4 + 2, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + i4 + 3, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + i4 + 3, ((k1 - k5) + 1) - j6, l1 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + i4 + 4, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + i4 + 5, k1 - k5 - j6, l1 + 4, pickBlock(random));
|
||||
setBlock(world,j1 + i4, k1 - k5 - j6, l1 + 5, pickBlock(random));
|
||||
setBlock(world,j1 + i4, ((k1 - k5) + 1) - j6, l1 + 5, pickBlock(random));
|
||||
setBlock(world,j1 + i4, ((k1 - k5) + 2) - j6, l1 + 6, pickBlock(random));
|
||||
setBlock(world,j1 + i4, k1 - k5 - j6, l1 + 7, pickBlock(random));
|
||||
setBlock(world,j1 + i4, ((k1 - k5) + 1) - j6, l1 + 7, pickBlock(random));
|
||||
setBlock(world,j1 + i4, ((k1 - k5) + 2) - j6, l1 + 7, pickBlock(random));
|
||||
setBlock(world,j1 + i4, k1 - k5 - j6, l1 + 8, pickBlock(random));
|
||||
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;
|
||||
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.getBlock(j1 - j3, k1 - k5 - i7, l1 + i4) == Blocks.water || world.getBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Blocks.water
|
||||
|| world.getBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Blocks.water) {
|
||||
j6++;
|
||||
} else {
|
||||
flag1 = true;
|
||||
}
|
||||
} while (!flag1 && i7++ < 12);
|
||||
setBlock(world,(j1 - j3) + 1, k1 - k5 - j6, l1 + i4, pickBlock(random));
|
||||
setBlock(world,(j1 - j3) + 1, ((k1 - k5) + 1) - j6, l1 + i4, pickBlock(random));
|
||||
setBlock(world,(j1 - j3) + 1, ((k1 - k5) + 2) - j6, l1 + i4, pickBlock(random));
|
||||
setBlock(world,(j1 - j3) + 2, k1 - k5 - j6, l1 + i4, pickBlock(random));
|
||||
setBlock(world,j1 - j3, k1 - k5 - j6, (l1 + i4) - 1, pickBlock(random));
|
||||
setBlock(world,j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 1, pickBlock(random));
|
||||
setBlock(world,j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 1, pickBlock(random));
|
||||
setBlock(world,j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 1, pickBlock(random));
|
||||
setBlock(world,j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 1, pickBlock(random));
|
||||
setBlock(world,j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 2, pickBlock(random));
|
||||
setBlock(world,j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 2, pickBlock(random));
|
||||
setBlock(world,j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 2, pickBlock(random));
|
||||
setBlock(world,j1 - j3, ((k1 - k5) + 5) - j6, (l1 + i4) - 2, pickBlock(random));
|
||||
setBlock(world,j1 - j3, k1 - k5 - j6, (l1 + i4) - 3, pickBlock(random));
|
||||
setBlock(world,j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 3, pickBlock(random));
|
||||
setBlock(world,j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 3, pickBlock(random));
|
||||
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;
|
||||
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.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Blocks.water || world.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Blocks.water
|
||||
|| world.getBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Blocks.water) {
|
||||
j6++;
|
||||
} else {
|
||||
flag1 = true;
|
||||
}
|
||||
} while (!flag1 && i7++ < 12);
|
||||
setBlock(world,j1 + j3 + 4, k1 - k5 - j6, l1 - 6, pickBlock(random));
|
||||
setBlock(world,j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 6, pickBlock(random));
|
||||
setBlock(world,j1 + j3 + 4, ((k1 - k5) + 2) - j6, l1 - 6, pickBlock(random));
|
||||
setBlock(world,j1 + j3 + 4, k1 - k5 - j6, l1 - 7, pickBlock(random));
|
||||
setBlock(world,j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 7, pickBlock(random));
|
||||
setBlock(world,j1 + j3 + 5, k1 - k5 - j6, l1 - 7, pickBlock(random));
|
||||
setBlock(world,j1 + j3 + 5, ((k1 - k5) + 1) - j6, l1 - 7, pickBlock(random));
|
||||
setBlock(world,j1 + j3 + 5, ((k1 - k5) + 2) - j6, l1 - 7, pickBlock(random));
|
||||
setBlock(world,j1 + j3 + 6, k1 - k5 - j6, l1 - 7, pickBlock(random));
|
||||
l7 = random.nextInt(100);
|
||||
if (l7 <= 30) {
|
||||
setBlock(world,j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Blocks.dirt);
|
||||
setBlock(world,j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Blocks.dirt);
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
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,27 +1,28 @@
|
|||
package mysticstones.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.util.Icon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mysticstones.MysticStones;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockPlanks extends BlockMulti {
|
||||
public BlockPlanks(int ID) {
|
||||
super(ID, Material.wood);
|
||||
setHardness(2.5F);
|
||||
setResistance(10F);
|
||||
setUnlocalizedName("BlockMysticPlanks");
|
||||
setStepSound(Block.soundWoodFootstep);
|
||||
public BlockPlanks() {
|
||||
super(Material.wood);
|
||||
setHardness(2.5F);
|
||||
setResistance(10F);
|
||||
setBlockName("BlockMysticPlanks");
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
textures = new Icon[ItemPlanks.PLANK_TYPE.length];
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
textures = new IIcon[MysticStones.PLANK_TYPE.size()];
|
||||
for (int i = 0; i < textures.length; i++) {
|
||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemPlanks.PLANK_TYPE[i]);
|
||||
textures[i] = iconRegister.registerIcon("mysticstones:" + MysticStones.PLANK_TYPE.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,33 @@
|
|||
package mysticstones.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockReinforced extends BlockMulti {
|
||||
public BlockReinforced(int ID) {
|
||||
super(ID, Material.iron);
|
||||
setHardness(4F);
|
||||
setResistance(2000F);
|
||||
setUnlocalizedName("BlockMysticReinforcedBrick");
|
||||
setStepSound(Block.soundMetalFootstep);
|
||||
public BlockReinforced() {
|
||||
super(Material.iron);
|
||||
setHardness(4F);
|
||||
setResistance(2000F);
|
||||
setBlockName("BlockMysticReinforcedBrick");
|
||||
setStepSound(Block.soundTypeMetal);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
textures = new Icon[ItemReinforced.BRICK_TYPE.length];
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
textures = new IIcon[ItemReinforced.BRICK_TYPE.size()];
|
||||
for (int i = 0; i < textures.length; i++) {
|
||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemReinforced.BRICK_TYPE[i] + " Bricks");
|
||||
textures[i] = iconRegister.registerIcon("mysticstones:" + ItemReinforced.BRICK_TYPE.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,28 @@
|
|||
package mysticstones.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.util.Icon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mysticstones.MysticStones;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockStoneBricks extends BlockMulti {
|
||||
public BlockStoneBricks(int ID) {
|
||||
super(ID, Material.rock);
|
||||
setHardness(2F);
|
||||
setResistance(5F);
|
||||
setUnlocalizedName("BlockMysticStoneBricks");
|
||||
setStepSound(Block.soundStoneFootstep);
|
||||
public BlockStoneBricks() {
|
||||
super(Material.rock);
|
||||
setHardness(2F);
|
||||
setResistance(5F);
|
||||
setBlockName("BlockMysticStoneBricks");
|
||||
setStepSound(Block.soundTypeStone);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
textures = new Icon[ItemStoneBricks.STONEBRICK_TYPES.length];
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
textures = new IIcon[MysticStones.STONEBRICK_TYPES.size()];
|
||||
for (int i = 0; i < textures.length; i++) {
|
||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemStoneBricks.STONEBRICK_TYPES[i]);
|
||||
textures[i] = iconRegister.registerIcon("mysticstones:" + MysticStones.STONEBRICK_TYPES.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,23 @@
|
|||
package mysticstones.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mysticstones.MysticStones;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockStones extends BlockMulti {
|
||||
public BlockStones(int ID) {
|
||||
super(ID, Material.rock);
|
||||
setHardness(1F);
|
||||
setResistance(5F);
|
||||
setUnlocalizedName("BlockMysticStones");
|
||||
setStepSound(Block.soundStoneFootstep);
|
||||
public BlockStones() {
|
||||
super(Material.rock);
|
||||
setHardness(1F);
|
||||
setResistance(5F);
|
||||
setBlockName("BlockMysticStones");
|
||||
setStepSound(Block.soundTypeStone);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -48,15 +49,10 @@ public class BlockStones extends BlockMulti {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
textures = new Icon[ItemStones.STONE_TYPES.length];
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
textures = new IIcon[MysticStones.STONE_TYPES.size()];
|
||||
for (int i = 0; i < textures.length; i++) {
|
||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemStones.STONE_TYPES[i]);
|
||||
textures[i] = iconRegister.registerIcon("mysticstones:" + MysticStones.STONE_TYPES.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
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,24 +1,27 @@
|
|||
package mysticstones.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mysticstones.MysticStones;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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;
|
||||
|
||||
public class ItemReinforced extends ItemBlockMulti {
|
||||
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 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",
|
||||
"Agate Bricks"));
|
||||
|
||||
public ItemReinforced(int par1) {
|
||||
super(par1, MysticStones.ReinforcedBricks, BRICK_TYPE);
|
||||
public ItemReinforced(Block block) {
|
||||
super(block, BRICK_TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
if (par4) {
|
||||
par3List.add("Works As A Beacon Block Too!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
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,51 +1,62 @@
|
|||
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.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
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.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;
|
||||
|
||||
@Mod(modid = "Mystic Stones", name = "Mystic Stones", version = "0.1")
|
||||
@NetworkMod(clientSideRequired = true)
|
||||
public class MysticStones {
|
||||
@Instance("Mystic Stones")
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Mod(modid = "mysticstones", name = "Mystic Stones", version = "0.2")
|
||||
public final class MysticStones {
|
||||
@Instance("mysticstones")
|
||||
public static MysticStones instance;
|
||||
public static Block Planks, Stones, StoneBricks, ReinforcedBricks;
|
||||
public static final CreativeTabs MysticStonesTab = new TabMysticStones("MysticStonesTab");
|
||||
public static boolean ENABLE = true;
|
||||
public static Block planks, stones, stoneBricks, reinforcedBricks;
|
||||
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) {
|
||||
Config.initialize(event.getSuggestedConfigurationFile());
|
||||
Planks = new BlockPlanks(Config.PlanksID);
|
||||
Stones = new BlockStones(Config.StonesID);
|
||||
StoneBricks = new BlockStoneBricks(Config.StoneBricksID);
|
||||
ReinforcedBricks = new BlockReinforced(Config.ReinforcedBricksID);
|
||||
GameRegistry.registerBlock(Planks, ItemPlanks.class, "Planks");
|
||||
GameRegistry.registerBlock(Stones, ItemStones.class, "Stones");
|
||||
GameRegistry.registerBlock(StoneBricks, ItemStoneBricks.class, "StoneBricks");
|
||||
GameRegistry.registerBlock(ReinforcedBricks, ItemReinforced.class, "Reinforcedbricks");
|
||||
Localizations.Initialize();
|
||||
RecipeHandler.CraftPlanks();
|
||||
RecipeHandler.CraftStoneBricks();
|
||||
RecipeHandler.CraftReinforced();
|
||||
RecipeHandler.CraftElse();
|
||||
GameRegistry.registerWorldGenerator(new WorldGeneratorStones());
|
||||
if(ENABLE){
|
||||
MysticStonesTab = new CreativeTabs("MysticStonesTab") {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int func_151243_f()
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
@Override
|
||||
public Item getTabIconItem() {
|
||||
return Item.getItemFromBlock(MysticStones.reinforcedBricks);
|
||||
}
|
||||
};
|
||||
planks = GameRegistry.registerBlock(new BlockPlanks(), ItemBlockMulti.class, "Planks", PLANK_TYPE);
|
||||
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,27 +1,23 @@
|
|||
package mysticstones.util;
|
||||
|
||||
import java.util.List;
|
||||
import mysticstones.MysticStones;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import java.util.List;
|
||||
|
||||
public class Config {
|
||||
public static int PlanksID;
|
||||
public static int StonesID;
|
||||
public static int StoneBricksID;
|
||||
public static int ReinforcedBricksID;
|
||||
public static int Rare;
|
||||
public static List<Integer> allowed = new ArrayList();
|
||||
public static final String[] keys = { "anorthosite", "limestone", "marble", "migmatite", "orthogneiss", "slate", "travertine" };
|
||||
public static int[] rare = new int[keys.length];
|
||||
public static List<Integer> allowed = new ArrayList<Integer>();
|
||||
|
||||
public static void initialize(File file) {
|
||||
Configuration config = new Configuration(file);
|
||||
config.load();
|
||||
PlanksID = config.getBlock("Plank IDs", 509).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();
|
||||
MysticStones.ENABLE = config.get("General", "Enable", true).getBoolean(true);
|
||||
for (int i = 0; i < rare.length; i++) {
|
||||
rare[i] = config.get("Generation", "Rarity of " + keys[i], 3).getInt();
|
||||
}
|
||||
for (String id : config.get("Generation", "Allowed Dimension ID", "0,").getString().split(",")) {
|
||||
try {
|
||||
allowed.add(Integer.parseInt(id.trim()));
|
||||
|
|
|
|||
|
|
@ -1,95 +0,0 @@
|
|||
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,48 +1,45 @@
|
|||
package mysticstones.util;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import mysticstones.MysticStones;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class RecipeHandler {
|
||||
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",
|
||||
"orthogneiss", "slateSmooth", "slate", "travertineSmooth", "travertine" };
|
||||
|
||||
public static void CraftElse() {
|
||||
public static void craftElse() {
|
||||
//smelting
|
||||
for (int i = 1; i < 14; i += 2) {
|
||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, i, new ItemStack(MysticStones.Stones, 1, i - 1), 0.1F);
|
||||
FurnaceRecipes.smelting().func_151394_a(new ItemStack(MysticStones.stones, 1, 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++) {
|
||||
ItemStack stack = new ItemStack(MysticStones.Planks, 1, i);
|
||||
ItemStack stack = new ItemStack(MysticStones.planks, 1, i);
|
||||
OreDictionary.registerOre("plankWood", stack);
|
||||
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], new ItemStack(MysticStones.stones, 1, 2 * i));
|
||||
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 + 1]));
|
||||
}
|
||||
}
|
||||
|
||||
public static void CraftReinforced() {
|
||||
if (Loader.isModLoaded("MysticOres")) {
|
||||
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 craftReinforced() {
|
||||
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++) {
|
||||
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]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
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,25 +1,26 @@
|
|||
package mysticworld.biome;
|
||||
|
||||
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.block.Block;
|
||||
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 BiomeGenBasic(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) {
|
||||
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) {
|
||||
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.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,29 +1,10 @@
|
|||
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.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;
|
||||
}
|
||||
public class BiomeGenGlacier extends BiomeGenTundra {
|
||||
public BiomeGenGlacier(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, Block blockTop, Block blockFiller) {
|
||||
super(id, treesChunk, grassChunk, flowerChunk, reedsChunk, blockTop, blockFiller);
|
||||
this.waterColorMultiplier = 15397370;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,58 +1,19 @@
|
|||
package mysticworld.biome;
|
||||
|
||||
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.WorldGenAbstractTree;
|
||||
import net.minecraft.world.gen.feature.WorldGenMegaJungle;
|
||||
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 BiomeGenBase
|
||||
{
|
||||
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));
|
||||
}
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Gets a WorldGen appropriate for this biome.
|
||||
*/
|
||||
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)));
|
||||
}
|
||||
public class BiomeGenJungle extends net.minecraft.world.biome.BiomeGenJungle {
|
||||
public BiomeGenJungle(int par1) {
|
||||
super(par1, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public WorldGenAbstractTree func_150567_a(Random par1Random) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
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,28 +1,13 @@
|
|||
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.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;;
|
||||
public class BiomeGenTundra extends BiomeGenBasic {
|
||||
public BiomeGenTundra(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, Block blockTop, Block blockFiller) {
|
||||
super(id, treesChunk, grassChunk, flowerChunk, reedsChunk, blockTop, blockFiller);
|
||||
this.spawnableCreatureList.clear();
|
||||
this.spawnableMonsterList.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,10 +1,9 @@
|
|||
package mysticworld.biome;
|
||||
|
||||
import mysticworld.lib.Booleans;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeManager;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BiomeHandler {
|
||||
public static BiomeGenBase Mountain;
|
||||
|
|
@ -13,49 +12,33 @@ public class BiomeHandler {
|
|||
public static BiomeGenBase Glacier;
|
||||
public static BiomeGenBase Jungle;
|
||||
|
||||
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() {
|
||||
public static void init(){
|
||||
if (Booleans.ENABLE_JUNGLE_REWRITE) {
|
||||
GameRegistry.removeBiome(BiomeGenBase.jungle);
|
||||
GameRegistry.removeBiome(BiomeGenBase.jungleHills);
|
||||
GameRegistry.addBiome(Jungle);
|
||||
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));
|
||||
BiomeManager.addSpawnBiome(Jungle);
|
||||
BiomeManager.addStrongholdBiome(Jungle);
|
||||
}
|
||||
if (Booleans.ENABLE_GLACIER_GEN) {
|
||||
GameRegistry.addBiome(Glacier);
|
||||
BiomeManager.addStrongholdBiome(Glacier);
|
||||
}
|
||||
if (Booleans.ENABLE_MOUNTAIN_GEN) {
|
||||
GameRegistry.addBiome(Mountain);
|
||||
Mountain = new BiomeGenBasic(53, Blocks.stone, Blocks.stone).setColor(9286496).setBiomeName("Mountain").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
|
||||
.setHeight(new BiomeGenBase.Height(0.5F, 1.0F));
|
||||
BiomeManager.addSpawnBiome(Mountain);
|
||||
BiomeManager.addStrongholdBiome(Mountain);
|
||||
}
|
||||
if (Booleans.ENABLE_TUNDRA_GEN) {
|
||||
GameRegistry.addBiome(Tundra);
|
||||
Tundra = new BiomeGenTundra(54, 0, 0, 0, 0, Blocks.snow, Blocks.snow).setColor(9286496).setBiomeName("Tundra").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F)
|
||||
.setHeight(new BiomeGenBase.Height(0.8F, 0.4F));
|
||||
BiomeManager.addStrongholdBiome(Tundra);
|
||||
}
|
||||
if (Booleans.ENABLE_STEPPE_GEN) {
|
||||
GameRegistry.addBiome(Steppe);
|
||||
Steppe = new BiomeGenBasic(55, 0, 2, 2, 3, Blocks.grass, Blocks.dirt).setColor(5470985).setBiomeName("Steppe").setHeight(new BiomeGenBase.Height(0.1F, 0.1F));
|
||||
BiomeManager.addSpawnBiome(Steppe);
|
||||
BiomeManager.addVillageBiome(Steppe, true);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,170 +0,0 @@
|
|||
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,38 +1,25 @@
|
|||
package mysticworld.blocks;
|
||||
|
||||
import mysticworld.lib.BlockIds;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import mysticworld.lib.Strings;
|
||||
import net.minecraft.block.Block;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class BlockHandler {
|
||||
public static Block oreImbuedStone;
|
||||
public static Block bush;
|
||||
public static Block lightCube;
|
||||
public static Block pillarPlatform;
|
||||
public static Block pillar;
|
||||
public static Block pillarInsert;
|
||||
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 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,
|
||||
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 static Block oreImbuedStone, bush, lightCube, pillarPlatform, pillar, pillarInsert;
|
||||
|
||||
public static void init() {
|
||||
oreImbuedStone = new BlockImbuedStone(BlockIds.ORE_STONE_1).setUnlocalizedName(Strings.IMBUED_STONE_NAME);
|
||||
bush = new BlockBush(BlockIds.BUSH).setUnlocalizedName(Strings.BUSH_NAME);
|
||||
lightCube = new BlockLightCube(BlockIds.LIGHT_CUBE).setUnlocalizedName(Strings.LIGHT_CUBE_NAME);
|
||||
pillarPlatform = new BlockPlatform(BlockIds.PLATFORM).setUnlocalizedName(Strings.PLATFORM_NAME);
|
||||
pillar = new BlockPillar(BlockIds.PILLAR).setUnlocalizedName(Strings.PILLAR_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() {
|
||||
oreImbuedStone = GameRegistry.registerBlock(new BlockImbuedStone().setBlockName(Strings.IMBUED_STONE_NAME), ItemBlockMulti.class, Strings.IMBUED_STONE_NAME, IMBUED_STONE_TYPE);
|
||||
bush = GameRegistry.registerBlock(new BlockBushes().setBlockName(Strings.BUSH_NAME), ItemBlockMulti.class, Strings.BUSH_NAME, BUSH_TYPES);
|
||||
lightCube = GameRegistry.registerBlock(new BlockLightCube().setBlockName(Strings.LIGHT_CUBE_NAME).setBlockTextureName("mysticworld:lightCube"), Strings.LIGHT_CUBE_NAME);
|
||||
pillarPlatform = GameRegistry.registerBlock(new BlockPlatform().setBlockName(Strings.PLATFORM_NAME).setBlockTextureName("mysticworld:Platform"), Strings.PLATFORM_NAME);
|
||||
pillar = GameRegistry.registerBlock(new BlockPillar().setBlockName(Strings.PILLAR_NAME).setBlockTextureName("mysticworld:Pillar"), Strings.PILLAR_NAME);
|
||||
pillarInsert = GameRegistry.registerBlock(new BlockPillarInsert().setBlockName(Strings.PILLAR_INSERT_NAME), Strings.PILLAR_INSERT_NAME);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,37 @@
|
|||
package mysticworld.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mysticworld.MysticWorld;
|
||||
import mysticworld.items.ItemHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockImbuedStone extends Block {
|
||||
Icon[] textures;
|
||||
IIcon[] textures;
|
||||
|
||||
public BlockImbuedStone(int ID) {
|
||||
super(ID, Material.rock);
|
||||
setHardness(0.5F);
|
||||
setResistance(5F);
|
||||
public BlockImbuedStone() {
|
||||
super(Material.rock);
|
||||
setHardness(0.5F);
|
||||
setResistance(5F);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.125F, 0.75F);
|
||||
setLightValue(0.625f);
|
||||
setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.125F, 0.75F);
|
||||
setLightLevel(0.625f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||
return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||
return World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -44,30 +45,22 @@ public class BlockImbuedStone extends Block {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item i, CreativeTabs tab, List list) {
|
||||
for (int j = 0; j < 5; j++) {
|
||||
list.add(new ItemStack(i, 1, j));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
return ItemHandler.imbuedShard.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idPicked(World par1World, int par2, int par3, int par4) {
|
||||
return blockID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
public Item getItemDropped(int par1, Random par2Random, int par3) {
|
||||
return ItemHandler.imbuedShard;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -76,9 +69,9 @@ public class BlockImbuedStone extends Block {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) {
|
||||
boolean flag = false;
|
||||
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4))) {
|
||||
if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) && !BlockFence.func_149825_a(par1World.getBlock(par2, par3 - 1, par4))) {
|
||||
flag = true;
|
||||
}
|
||||
if (flag) {
|
||||
|
|
@ -89,24 +82,24 @@ public class BlockImbuedStone extends Block {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
textures = new Icon[16];
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
textures = new IIcon[16];
|
||||
for (int i = 0; i < 5; i++) {
|
||||
textures[i] = iconRegister.registerIcon("MysticMods" + ":" + ItemImbuedStone.IMBUED_STONE_TYPE[i] + " Imbued Stone");
|
||||
textures[i] = iconRegister.registerIcon("mysticworld:" + BlockHandler.IMBUED_STONE_TYPE.get(i).substring(11) + " Imbued Stone");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
public int xpDropAmount(int j) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,52 +1,42 @@
|
|||
package mysticworld.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
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.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockLightCube extends Block {
|
||||
public BlockLightCube(int id) {
|
||||
super(id, Material.circuits);
|
||||
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||
setLightValue(1.0F);
|
||||
this.setTickRandomly(true);
|
||||
public BlockLightCube() {
|
||||
super(Material.circuits);
|
||||
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||
setLightLevel(1.0F);
|
||||
setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
public Item getItemDropped(int par1, Random par2Random, int par3) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "lightCube");
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,32 +3,23 @@ package mysticworld.blocks;
|
|||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.block.Block;
|
||||
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 BlockPillar(int id) {
|
||||
super(id, Material.rock);
|
||||
setBlockUnbreakable();
|
||||
setResistance(6000000.0F);
|
||||
public BlockPillar() {
|
||||
super(Material.rock);
|
||||
setBlockUnbreakable();
|
||||
setResistance(6000000.0F);
|
||||
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
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon("MysticMods" + ":" + "Pillar");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,41 @@
|
|||
package mysticworld.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mysticworld.MysticWorld;
|
||||
import mysticworld.tiles.TileEntityPillarInsert;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPillarInsert extends BlockContainer {
|
||||
public class BlockPillarInsert extends Block {
|
||||
public static int RENDER_PILLAR_INSERT;
|
||||
|
||||
public BlockPillarInsert(int id) {
|
||||
super(id, Material.rock);
|
||||
public BlockPillarInsert() {
|
||||
super(Material.rock);
|
||||
this.setBlockUnbreakable();
|
||||
this.setResistance(6000000.0F);
|
||||
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
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createTileEntity(World world, int i) {
|
||||
return new TileEntityPillarInsert();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -36,27 +45,33 @@ public class BlockPillarInsert extends BlockContainer {
|
|||
return RENDER_PILLAR_INSERT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
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 (Item.enderPearl.itemID == entityPlayer.inventory.getCurrentItem().itemID) {
|
||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||
if (Items.ender_pearl == entityPlayer.inventory.getCurrentItem().getItem()) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
}
|
||||
|
||||
@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) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,23 @@
|
|||
package mysticworld.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
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.entity.Entity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockPillarPlatform extends Block {
|
||||
public BlockPillarPlatform(int id) {
|
||||
super(id, Material.rock);
|
||||
public BlockPillarPlatform() {
|
||||
super(Material.rock);
|
||||
this.setBlockUnbreakable();
|
||||
this.setResistance(6000000.0F);
|
||||
this.setTickRandomly(true);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -31,6 +28,7 @@ public class BlockPillarPlatform extends Block {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
double posX = x;
|
||||
double posY = y;
|
||||
|
|
@ -40,10 +38,15 @@ public class BlockPillarPlatform extends Block {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World par1World) {
|
||||
|
|
@ -57,11 +60,11 @@ public class BlockPillarPlatform extends Block {
|
|||
}
|
||||
|
||||
private boolean isTowersNearby(World world, int x, int y, int z) {
|
||||
int block = BlockHandler.pillar.blockID;
|
||||
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.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.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.getBlockId(x + 2, y + 2, z + 2) == block && world.getBlockId(x + 2, y + 2, z - 2) == block) {
|
||||
Block block = BlockHandler.pillar;
|
||||
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
|
||||
&& 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.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.getBlock(x + 2, y + 2, z + 2) == block && world.getBlock(x + 2, y + 2, z - 2) == block) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -5,21 +5,21 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockPillarTower extends Block {
|
||||
public BlockPillarTower(int id) {
|
||||
super(id, Material.rock);
|
||||
setBlockUnbreakable();
|
||||
setResistance(6000000.0F);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||
public BlockPillarTower() {
|
||||
super(Material.rock);
|
||||
setBlockUnbreakable();
|
||||
setResistance(6000000.0F);
|
||||
setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,37 @@
|
|||
package mysticworld.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
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.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;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockPlatform extends Block {
|
||||
public BlockPlatform(int id) {
|
||||
super(id, Material.rock);
|
||||
this.setBlockUnbreakable();
|
||||
this.setResistance(6000000.0F);
|
||||
this.setTickRandomly(true);
|
||||
public BlockPlatform() {
|
||||
super(Material.rock);
|
||||
setBlockUnbreakable();
|
||||
setResistance(6000000.0F);
|
||||
setTickRandomly(true);
|
||||
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
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
|
||||
super.onEntityWalking(world, x, y, z, entity);
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
int block = BlockHandler.pillar.blockID;
|
||||
double posX = x;
|
||||
double posY = y;
|
||||
double posZ = z;
|
||||
|
|
@ -48,17 +46,6 @@ 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
|
||||
public int tickRate(World par1World) {
|
||||
return 30;
|
||||
|
|
@ -69,12 +56,12 @@ public class BlockPlatform extends Block {
|
|||
}
|
||||
|
||||
private boolean isTowersNearby(World world, int x, int y, int z) {
|
||||
int pillar = BlockHandler.pillar.blockID;
|
||||
int insert = BlockHandler.pillarInsert.blockID;
|
||||
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.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.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.getBlockId(x + 2, y + 2, z + 2) == pillar && world.getBlockId(x + 2, y + 2, z - 2) == pillar) {
|
||||
Block pillar = BlockHandler.pillar;
|
||||
Block insert = BlockHandler.pillarInsert;
|
||||
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
|
||||
&& 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.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.getBlock(x + 2, y + 2, z + 2) == pillar && world.getBlock(x + 2, y + 2, z - 2) == pillar) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
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];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
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,70 +1,49 @@
|
|||
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.BlockPillarInsert;
|
||||
import mysticworld.client.fx.LightCubeFX;
|
||||
import mysticworld.client.fx.PowerAirFX;
|
||||
import mysticworld.client.fx.PowerEarthFX;
|
||||
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.client.fx.PowerFX;
|
||||
import mysticworld.entity.*;
|
||||
import mysticworld.items.ItemHandler;
|
||||
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.renderer.*;
|
||||
import mysticworld.tiles.TileEntityPillarInsert;
|
||||
import mysticworld.util.CommonProxy;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
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 final Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
@Override
|
||||
public int addArmor(String armor) {
|
||||
return RenderingRegistry.addNewArmourRendererPrefix(armor);
|
||||
}
|
||||
public static final ResourceLocation particle = new ResourceLocation("textures/particle/particles.png");
|
||||
|
||||
//particles
|
||||
@Override
|
||||
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age) {
|
||||
PowerAirFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
|
||||
PowerFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
|
||||
mc.effectRenderer.addEffect(airFX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void earthFX(World worldObj, double x, double y, double z, float scale) {
|
||||
PowerEarthFX earthFX = new PowerEarthFX(worldObj, x, y, z, scale);
|
||||
PowerFX earthFX = new PowerFX(worldObj, x, y, z, scale).setTexture("earth");
|
||||
mc.effectRenderer.addEffect(earthFX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void energyFX(World worldObj, double x, double y, double z, float scale) {
|
||||
PowerEnergyFX energyFX = new PowerEnergyFX(worldObj, x, y, z, scale);
|
||||
PowerFX energyFX = new PowerFX(worldObj, x, y, z, scale).setTexture("energy");
|
||||
mc.effectRenderer.addEffect(energyFX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireFX(World worldObj, double x, double y, double z, float scale) {
|
||||
PowerFireFX fireFX = new PowerFireFX(worldObj, x, y, z, scale);
|
||||
PowerFX fireFX = new PowerFX(worldObj, x, y, z, scale).setTexture("fire");
|
||||
mc.effectRenderer.addEffect(fireFX);
|
||||
}
|
||||
|
||||
|
|
@ -77,28 +56,28 @@ public class ClientProxy extends CommonProxy {
|
|||
@Override
|
||||
public void registerRenders() {
|
||||
BlockPillarInsert.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId();
|
||||
MinecraftForgeClient.registerItemRenderer(BlockHandler.pillarInsert.blockID, new BlockPillarInsertRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff.itemID, new ItemStaffFireRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff.itemID, new ItemStaffEarthRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff.itemID, new ItemStaffAirRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff.itemID, new ItemStaffEnergyRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff.itemID, new ItemStaffWaterRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb.itemID, new ItemOrbFireRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb.itemID, new ItemOrbEarthRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb.itemID, new ItemOrbAirRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb.itemID, new ItemOrbEnergyRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb.itemID, new ItemOrbWaterRenderer());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower(0));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower(1));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower(2));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeAir.class, new RenderStaffPower(3));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEnergy.class, new RenderStaffPower(4));
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockHandler.pillarInsert), new BlockPillarInsertRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff, new StaffItemRenderer("Fire"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff, new StaffItemRenderer("Water"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff, new StaffItemRenderer("Earth"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff, new StaffItemRenderer("Air"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff, new StaffItemRenderer("Energy"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb, new OrbItemRenderer("Fire"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb, new OrbItemRenderer("Water"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb, new OrbItemRenderer("Earth"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb, new OrbItemRenderer("Air"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb, new OrbItemRenderer("Energy"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower("Fire"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower("Water"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower("Earth"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeAir.class, new RenderStaffPower("Air"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEnergy.class, new RenderStaffPower("Energy"));
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPillarInsert.class, new TileEntityPillarInsertRenderer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void waterFX(World worldObj, double x, double y, double z, float scale) {
|
||||
PowerWaterFX waterFX = new PowerWaterFX(worldObj, x, y, z, scale);
|
||||
PowerFX waterFX = new PowerFX(worldObj, x, y, z, scale).setTexture("water");
|
||||
mc.effectRenderer.addEffect(waterFX);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,15 @@
|
|||
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 LightCubeFX extends EntityFX {
|
||||
public class LightCubeFX extends PowerFX {
|
||||
public LightCubeFX(World world, double x, double y, double 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) {
|
||||
super(world, x, y, z);
|
||||
this(world, x, y, z);
|
||||
this.motionX *= 0.10000000149011612D;
|
||||
this.motionY *= 0.10000000149011612D;
|
||||
this.motionZ *= 0.10000000149011612D;
|
||||
|
|
@ -29,55 +23,4 @@ public class LightCubeFX extends EntityFX {
|
|||
this.noClip = true;
|
||||
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,22 +1,16 @@
|
|||
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.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class PowerAirFX extends EntityFX {
|
||||
public class PowerAirFX extends PowerFX {
|
||||
public PowerAirFX(World world, double x, double y, double 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) {
|
||||
super(world, x, y, z);
|
||||
this(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.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);
|
||||
|
|
@ -31,7 +25,7 @@ public class PowerAirFX extends EntityFX {
|
|||
}
|
||||
|
||||
public PowerAirFX(World world, double x, double y, double z, float scale, int age) {
|
||||
super(world, x, y, z);
|
||||
this(world, x, y, z);
|
||||
this.motionX += motionX;
|
||||
this.motionY += motionY;
|
||||
this.motionZ += motionZ;
|
||||
|
|
@ -48,56 +42,10 @@ public class PowerAirFX extends EntityFX {
|
|||
|
||||
@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;
|
||||
}
|
||||
super.onUpdate();
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
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,83 +0,0 @@
|
|||
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 PowerEarthFX extends EntityFX {
|
||||
public PowerEarthFX(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public PowerEarthFX(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/earthFX.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,83 +0,0 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
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,29 +1,12 @@
|
|||
package mysticworld.entity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.entity.Entity;
|
||||
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.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
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;
|
||||
public class EntityChargeAir extends EntityCharge {
|
||||
private float particleScale = 1.0f;
|
||||
private double powerHeight = 0.75D;
|
||||
|
||||
|
|
@ -32,110 +15,19 @@ public class EntityChargeAir extends Entity {
|
|||
}
|
||||
|
||||
public EntityChargeAir(World par1World, EntityPlayer par2EntityPlayer, float pScale, double pHeight) {
|
||||
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;
|
||||
super(par1World,par2EntityPlayer);
|
||||
this.particleScale = pScale;
|
||||
this.powerHeight = pHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith() {
|
||||
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.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;
|
||||
public void chargeFX() {
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||
Random rand = new Random();
|
||||
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);
|
||||
if (par1MovingObjectPosition.entityHit != null) {
|
||||
|
|
@ -143,7 +35,7 @@ public class EntityChargeAir extends Entity {
|
|||
if (f3 > 0.0F) {
|
||||
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 j = par1MovingObjectPosition.blockY;
|
||||
int k = par1MovingObjectPosition.blockZ;
|
||||
|
|
@ -166,16 +58,8 @@ public class EntityChargeAir extends Entity {
|
|||
case 5:
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
}
|
||||
|
|
@ -1,144 +1,33 @@
|
|||
package mysticworld.entity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
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.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
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;
|
||||
import java.util.Random;
|
||||
|
||||
public class EntityChargeEarth extends EntityCharge {
|
||||
public EntityChargeEarth(World par1World) {
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityChargeEarth(World par1World, EntityPlayer 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;
|
||||
super(par1World,par2EntityPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith() {
|
||||
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;
|
||||
public void chargeFX() {
|
||||
MysticWorld.proxy.earthFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||
Random rand = new Random();
|
||||
if (!this.worldObj.isRemote) {
|
||||
|
|
@ -146,19 +35,19 @@ public class EntityChargeEarth extends Entity {
|
|||
if (par1MovingObjectPosition.entityHit != null) {
|
||||
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
if (f3 > 0.0F) {
|
||||
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
|
||||
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 0.6000000238418579D / f3, 0.1D, this.motionZ * 0.6000000238418579D / f3);
|
||||
}
|
||||
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20);
|
||||
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(Block.mushroomBrown, 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(Block.sapling, rand.nextInt(2), 0)));
|
||||
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(Block.sapling, rand.nextInt(2), 1)));
|
||||
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(Block.sapling, rand.nextInt(2), 3)));
|
||||
this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.melonSeeds, rand.nextInt(3))));
|
||||
} else {
|
||||
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(Blocks.brown_mushroom, 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(Blocks.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(Blocks.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(Blocks.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))));
|
||||
}/* else {
|
||||
int i = par1MovingObjectPosition.blockX;
|
||||
int j = par1MovingObjectPosition.blockY;
|
||||
int k = par1MovingObjectPosition.blockZ;
|
||||
|
|
@ -181,16 +70,8 @@ public class EntityChargeEarth extends Entity {
|
|||
case 5:
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,134 +1,27 @@
|
|||
package mysticworld.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
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.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
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) {
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityChargeEnergy(World par1World, EntityPlayer 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;
|
||||
super(par1World,par2EntityPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith() {
|
||||
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;
|
||||
public void chargeFX() {
|
||||
MysticWorld.proxy.energyFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||
int i = par1MovingObjectPosition.blockX;
|
||||
int j = par1MovingObjectPosition.blockY;
|
||||
|
|
@ -142,7 +35,7 @@ public class EntityChargeEnergy extends Entity {
|
|||
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, par1MovingObjectPosition.entityHit.posX, par1MovingObjectPosition.entityHit.posY, par1MovingObjectPosition.entityHit.posZ));
|
||||
} else {
|
||||
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, i, j, k));
|
||||
switch (par1MovingObjectPosition.sideHit) {
|
||||
/*switch (par1MovingObjectPosition.sideHit) {
|
||||
case 0:
|
||||
--j;
|
||||
break;
|
||||
|
|
@ -160,17 +53,9 @@ public class EntityChargeEnergy extends Entity {
|
|||
break;
|
||||
case 5:
|
||||
++i;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
}
|
||||
|
|
@ -1,142 +1,35 @@
|
|||
package mysticworld.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
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) {
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityChargeFire(World par1World, EntityPlayer 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;
|
||||
super(par1World,par2EntityPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith() {
|
||||
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;
|
||||
public void chargeFX() {
|
||||
MysticWorld.proxy.fireFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||
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);
|
||||
if (par1MovingObjectPosition.entityHit != null) {
|
||||
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
if (f3 > 0.0F) {
|
||||
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
|
||||
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 0.6000000238418579D / f3, 0.1D, this.motionZ * 0.6000000238418579D / f3);
|
||||
}
|
||||
if (!par1MovingObjectPosition.entityHit.isImmuneToFire()) {
|
||||
par1MovingObjectPosition.entityHit.setFire(5);
|
||||
|
|
@ -166,18 +59,10 @@ public class EntityChargeFire extends Entity {
|
|||
++i;
|
||||
}
|
||||
if (this.worldObj.isAirBlock(i, j, k)) {
|
||||
this.worldObj.setBlock(i, j, k, Block.fire.blockID);
|
||||
this.worldObj.setBlock(i, j, k, Blocks.fire);
|
||||
}
|
||||
}
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,141 +1,34 @@
|
|||
package mysticworld.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.entity.Entity;
|
||||
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.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
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) {
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityChargeWater(World par1World, EntityPlayer 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;
|
||||
super(par1World,par2EntityPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith() {
|
||||
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;
|
||||
public void chargeFX() {
|
||||
MysticWorld.proxy.waterFX(this.worldObj, this.posX + (rand.nextDouble() / 2), this.posY + 0.5D, this.posZ + (rand.nextDouble() / 2), 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||
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);
|
||||
if (par1MovingObjectPosition.entityHit != null) {
|
||||
double f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
if (f3 > 0.0F) {
|
||||
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3);
|
||||
par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 0.6000000238418579D / f3, 0.1D, this.motionZ * 0.6000000238418579D / f3);
|
||||
}
|
||||
if (par1MovingObjectPosition.entityHit.isImmuneToFire()) {
|
||||
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20);
|
||||
|
|
@ -143,8 +36,8 @@ public class EntityChargeWater extends Entity {
|
|||
if (par1MovingObjectPosition.entityHit.isBurning()) {
|
||||
par1MovingObjectPosition.entityHit.extinguish();
|
||||
}
|
||||
} else {
|
||||
int i = par1MovingObjectPosition.blockX;
|
||||
}/* else {
|
||||
/*int i = par1MovingObjectPosition.blockX;
|
||||
int j = par1MovingObjectPosition.blockY;
|
||||
int k = par1MovingObjectPosition.blockZ;
|
||||
switch (par1MovingObjectPosition.sideHit) {
|
||||
|
|
@ -166,16 +59,8 @@ public class EntityChargeWater extends Entity {
|
|||
case 5:
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,21 @@
|
|||
package mysticworld.entity;
|
||||
|
||||
import mysticworld.MysticWorld;
|
||||
import mysticworld.lib.EntityIds;
|
||||
import mysticworld.lib.Strings;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import mysticworld.MysticWorld;
|
||||
import mysticworld.lib.Strings;
|
||||
|
||||
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() {
|
||||
registerEntities();
|
||||
}
|
||||
|
||||
public static void registerEntities() {
|
||||
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);
|
||||
EntityRegistry.registerModEntity(EntityChargeAir.class, Strings.ENTITY_AIR_CHARGE_NAME, ENTITY_AIR_CHARGE, MysticWorld.instance, 80, 3, false);
|
||||
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);
|
||||
EntityRegistry.registerModEntity(EntityChargeWater.class, Strings.ENTITY_WATER_CHARGE_NAME, ENTITY_WATER_CHARGE, MysticWorld.instance, 80, 3, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
package mysticworld.items;
|
||||
|
||||
import net.minecraft.item.EnumArmorMaterial;
|
||||
import net.minecraftforge.common.EnumHelper;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class EnumArmor
|
||||
{
|
||||
static EnumArmorMaterial Verdite = EnumHelper.addArmorMaterial("Verdite", 262, new int[]{2, 5, 4, 1}, 5);
|
||||
static EnumArmorMaterial Mithril = EnumHelper.addArmorMaterial("Mithril", 500, new int[]{2, 7, 6, 2}, 9);
|
||||
static EnumArmorMaterial Adamantine = EnumHelper.addArmorMaterial("Adamantine", 3000, new int[]{4, 9, 6, 4}, 13);
|
||||
static EnumArmorMaterial Iridium = EnumHelper.addArmorMaterial("Iridium", 4000, new int[]{4, 10, 7, 5}, 15);
|
||||
public static final ItemArmor.ArmorMaterial 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);
|
||||
public static final ItemArmor.ArmorMaterial 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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
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,82 +1,45 @@
|
|||
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.item.EnumArmorMaterial;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemArmorIridium extends ItemArmor {
|
||||
int ArmorType;
|
||||
String ArmorFile_1;
|
||||
String ArmorFile_2;
|
||||
|
||||
public ItemArmorIridium(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
||||
super(par1, par2EnumArmorMaterial, par3, par4);
|
||||
this.ArmorType = par4;
|
||||
public class ItemArmorIridium extends ItemMaterialArmor {
|
||||
public ItemArmorIridium(ArmorMaterial par2EnumArmorMaterial, int par4) {
|
||||
super(par2EnumArmorMaterial, par4);
|
||||
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
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||
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);
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
ItemStack helmet = player.getEquipmentInSlot(4);
|
||||
if (helmet != null) {
|
||||
if (helmet.itemID == ItemHandler.iridiumHelmet.itemID) {
|
||||
player.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 200, 0)));
|
||||
if (helmet.getItem() == ItemHandler.iridiumHelmet) {
|
||||
player.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 210, 0)));
|
||||
}
|
||||
}
|
||||
ItemStack plate = player.getEquipmentInSlot(3);
|
||||
if (plate != null) {
|
||||
if (plate.itemID == ItemHandler.iridiumChestplate.itemID) {
|
||||
if (plate.getItem() == ItemHandler.iridiumChestplate) {
|
||||
player.addPotionEffect((new PotionEffect(Potion.regeneration.getId(), 200, 0)));
|
||||
}
|
||||
}
|
||||
ItemStack legs = player.getEquipmentInSlot(2);
|
||||
if (legs != null) {
|
||||
if (legs.itemID == ItemHandler.iridiumLeggings.itemID) {
|
||||
if (legs.getItem() == ItemHandler.iridiumLeggings) {
|
||||
player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 200, 2)));
|
||||
player.addVelocity(0.0005, 0, 0.0005);
|
||||
player.stepHeight = 1.001F;
|
||||
}
|
||||
}
|
||||
ItemStack boots = player.getEquipmentInSlot(1);
|
||||
if (boots != null) {
|
||||
if (boots.itemID == ItemHandler.iridiumBoots.itemID) {
|
||||
if (boots.getItem() == ItemHandler.iridiumBoots) {
|
||||
player.fallDistance = 0.0F;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemBushFruit extends ItemFood {
|
||||
private Icon[] icons;
|
||||
private IIcon[] icons;
|
||||
private static final String[] FRUIT_TYPES = new String[] { "Mundane", "Poison", "Weakness", "Slowness", "Harming", "Wither", "Health", "Speed", "FireResistance", "Regen", "NightVision",
|
||||
"Invisibility" };
|
||||
|
||||
public ItemBushFruit(int id, int health) {
|
||||
super(id, health, 0.6F, false);
|
||||
public ItemBushFruit(int health) {
|
||||
super(health, 0.6F, false);
|
||||
this.setHasSubtypes(true);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
maxStackSize = 64;
|
||||
setAlwaysEdible();
|
||||
setUnlocalizedName("bushFruit");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int meta) {
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
int j = MathHelper.clamp_int(meta, 0, FRUIT_TYPES.length);
|
||||
return icons[j];
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ public class ItemBushFruit extends ItemFood {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int var4 = 0; var4 < FRUIT_TYPES.length; var4++) {
|
||||
par3List.add(new ItemStack(par1, 1, var4));
|
||||
}
|
||||
|
|
@ -60,10 +60,10 @@ public class ItemBushFruit extends ItemFood {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
icons = new Icon[FRUIT_TYPES.length];
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
icons = new IIcon[FRUIT_TYPES.length];
|
||||
for (int i = 0; i < FRUIT_TYPES.length; ++i) {
|
||||
icons[i] = iconRegister.registerIcon("MysticMods:Fruit" + FRUIT_TYPES[i]);
|
||||
icons[i] = iconRegister.registerIcon("mysticworld:Fruit" + FRUIT_TYPES[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -76,77 +76,77 @@ public class ItemBushFruit extends ItemFood {
|
|||
case 1:
|
||||
potion = player.getActivePotionEffect(Potion.poison);
|
||||
if (potion != null) {
|
||||
duration = potion.duration;
|
||||
duration = potion.getDuration();
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 160, 0));
|
||||
break;
|
||||
case 2:
|
||||
potion = player.getActivePotionEffect(Potion.weakness);
|
||||
if (potion != null) {
|
||||
duration = potion.duration;
|
||||
duration = potion.getDuration();
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.weakness.id, duration + 160, 0));
|
||||
break;
|
||||
case 3:
|
||||
potion = player.getActivePotionEffect(Potion.moveSlowdown);
|
||||
if (potion != null) {
|
||||
duration = potion.duration;
|
||||
duration = potion.getDuration();
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration + 160, 0));
|
||||
break;
|
||||
case 4:
|
||||
potion = player.getActivePotionEffect(Potion.harm);
|
||||
if (potion != null) {
|
||||
duration = potion.duration;
|
||||
duration = potion.getDuration();
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.harm.id, duration + 1, 0));
|
||||
break;
|
||||
case 5:
|
||||
potion = player.getActivePotionEffect(Potion.wither);
|
||||
if (potion != null) {
|
||||
duration = potion.duration;
|
||||
duration = potion.getDuration();
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.wither.id, duration + 160, 0));
|
||||
break;
|
||||
case 6:
|
||||
potion = player.getActivePotionEffect(Potion.heal);
|
||||
if (potion != null) {
|
||||
duration = potion.duration;
|
||||
duration = potion.getDuration();
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.heal.id, duration + 1, 0));
|
||||
break;
|
||||
case 7:
|
||||
potion = player.getActivePotionEffect(Potion.moveSpeed);
|
||||
if (potion != null) {
|
||||
duration = potion.duration;
|
||||
duration = potion.getDuration();
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, duration + 160, 0));
|
||||
break;
|
||||
case 8:
|
||||
potion = player.getActivePotionEffect(Potion.fireResistance);
|
||||
if (potion != null) {
|
||||
duration = potion.duration;
|
||||
duration = potion.getDuration();
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, duration + 160, 0));
|
||||
break;
|
||||
case 9:
|
||||
potion = player.getActivePotionEffect(Potion.regeneration);
|
||||
if (potion != null) {
|
||||
duration = potion.duration;
|
||||
duration = potion.getDuration();
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 160, 0));
|
||||
break;
|
||||
case 10:
|
||||
potion = player.getActivePotionEffect(Potion.nightVision);
|
||||
if (potion != null) {
|
||||
duration = potion.duration;
|
||||
duration = potion.getDuration();
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, duration + 160, 0));
|
||||
break;
|
||||
case 11:
|
||||
potion = player.getActivePotionEffect(Potion.invisibility);
|
||||
if (potion != null) {
|
||||
duration = potion.duration;
|
||||
duration = potion.getDuration();
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.invisibility.id, duration + 160, 0));
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,39 +1,37 @@
|
|||
package mysticworld.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mysticworld.MysticWorld;
|
||||
import mysticworld.lib.Strings;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemImbuedShard extends Item {
|
||||
private Icon[] icons;
|
||||
private IIcon[] icons;
|
||||
private static final String[] SHARD_TYPES = new String[] { "Fire", "Water", "Earth", "Air", "Energy" };
|
||||
|
||||
public ItemImbuedShard(int id) {
|
||||
super(id);
|
||||
public ItemImbuedShard() {
|
||||
super();
|
||||
this.setHasSubtypes(true);
|
||||
this.setUnlocalizedName(Strings.IMBUED_SHARD_NAME);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int meta) {
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
int j = MathHelper.clamp_int(meta, 0, 5);
|
||||
return icons[j];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int var4 = 0; var4 < SHARD_TYPES.length; var4++) {
|
||||
par3List.add(new ItemStack(par1, 1, var4));
|
||||
}
|
||||
|
|
@ -47,10 +45,10 @@ public class ItemImbuedShard extends Item {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
icons = new Icon[SHARD_TYPES.length];
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
icons = new IIcon[SHARD_TYPES.length];
|
||||
for (int i = 0; i < SHARD_TYPES.length; ++i) {
|
||||
icons[i] = iconRegister.registerIcon("MysticMods:Shard" + SHARD_TYPES[i]);
|
||||
icons[i] = iconRegister.registerIcon("mysticworld:Shard" + SHARD_TYPES[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,21 @@
|
|||
package mysticworld.items;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
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.item.Item;
|
||||
|
||||
public class ItemOrb extends Item {
|
||||
Random rand = new Random();
|
||||
|
||||
public ItemOrb(int id) {
|
||||
super(id);
|
||||
public ItemOrb() {
|
||||
super();
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(200);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,95 +5,86 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
public class ItemOrbAir extends ItemOrb {
|
||||
public ItemOrbAir(int id) {
|
||||
super(id);
|
||||
public ItemOrbAir() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
|
||||
if (itemStack.stackTagCompound == null)
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
if (itemStack.stackTagCompound.getBoolean("charging") == false) {
|
||||
itemStack.stackTagCompound.setBoolean("charging", true);
|
||||
}
|
||||
return itemStack;
|
||||
player.setItemInUse(itemStack, this.getMaxItemUseDuration(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) {
|
||||
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
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
if (itemStack.stackTagCompound == null)
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
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);
|
||||
}
|
||||
if (par5) {
|
||||
entity.fallDistance = 0.0F;
|
||||
chargeEffect(itemStack, world, entity);
|
||||
}
|
||||
}
|
||||
|
||||
private void chargeEffect(ItemStack itemStack, World world, EntityPlayer player) {
|
||||
double particleX = (player.posX - 0.5D) + rand.nextDouble();
|
||||
double particleZ = (player.posZ - 0.5D) + rand.nextDouble();
|
||||
if (!world.isRemote)
|
||||
MysticWorld.proxy.airFeetFX(world, particleX, player.posY, particleZ, 1.0f, 15);
|
||||
@Override
|
||||
public void onUsingTick(ItemStack stack, EntityPlayer player, int count){
|
||||
if (stack.stackTagCompound == null){
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
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) {
|
||||
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1);
|
||||
private void incrementData(ItemStack itemStack, int charge) {
|
||||
itemStack.stackTagCompound.setFloat("angle", itemStack.stackTagCompound.getFloat("angle") + 0.2f);
|
||||
itemStack.stackTagCompound.setDouble("radius", itemStack.stackTagCompound.getInteger("chargeTime") * 0.025D);
|
||||
itemStack.stackTagCompound.setDouble("radius", charge * 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) {
|
||||
itemStack.stackTagCompound.setInteger("chargeTime", 0);
|
||||
itemStack.stackTagCompound.setBoolean("charging", false);
|
||||
itemStack.stackTagCompound.setFloat("angle", 0);
|
||||
itemStack.stackTagCompound.setDouble("radius", 0);
|
||||
}
|
||||
|
||||
private void spiralEffect(ItemStack itemStack, World world, EntityPlayer player) {
|
||||
private void spiralEffect(ItemStack itemStack, World world, EntityPlayer player, int charge) {
|
||||
double particleX = player.posX + (MathHelper.cos(itemStack.stackTagCompound.getFloat("angle"))) * itemStack.stackTagCompound.getDouble("radius");
|
||||
double particleY = player.posY;
|
||||
double particleZ = player.posZ + (MathHelper.sin(itemStack.stackTagCompound.getFloat("angle"))) * itemStack.stackTagCompound.getDouble("radius");
|
||||
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);
|
||||
float particleScale = charge * 5.0f / getMaxItemUseDuration(itemStack);
|
||||
MysticWorld.proxy.airFeetFX(world, particleX, particleY, particleZ, 1.0f + particleScale, 15);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,19 @@
|
|||
package mysticworld.items;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import mysticworld.MysticWorld;
|
||||
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.block.IGrowable;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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;
|
||||
|
||||
public class ItemOrbEarth extends ItemOrb {
|
||||
public ItemOrbEarth(int id) {
|
||||
super(id);
|
||||
public ItemOrbEarth() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -41,124 +34,35 @@ public class ItemOrbEarth extends ItemOrb {
|
|||
@Override
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (par5) {
|
||||
MysticWorld.proxy.earthFX(world, (player.posX - 0.5D) + itemRand.nextDouble(), player.posY, (player.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean applyBonemeal(ItemStack itemStack, World par1World, int par2, int par3, int par4, EntityPlayer 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;
|
||||
public static boolean applyBonemeal(ItemStack itemStack, World world, int x, int y, int z, EntityPlayer player) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
BonemealEvent event = new BonemealEvent(player, world, block, x, y, z);
|
||||
if (MinecraftForge.EVENT_BUS.post(event)){
|
||||
return false;
|
||||
}
|
||||
if (event.getResult() == Event.Result.ALLOW){
|
||||
if (!world.isRemote){
|
||||
itemStack.damageItem(1, player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (block instanceof IGrowable){
|
||||
IGrowable igrowable = (IGrowable)block;
|
||||
if (igrowable.func_149851_a(world, x, y, z, world.isRemote)){
|
||||
if (!world.isRemote){
|
||||
if (igrowable.func_149852_a(world, world.rand, x, y, z)){
|
||||
igrowable.func_149853_b(world, world.rand, x, y, z);
|
||||
}
|
||||
itemStack.damageItem(1, player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,16 +2,18 @@ package mysticworld.items;
|
|||
|
||||
import mysticworld.MysticWorld;
|
||||
import mysticworld.blocks.BlockHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemOrbEnergy extends ItemOrb {
|
||||
public ItemOrbEnergy(int id) {
|
||||
super(id);
|
||||
public ItemOrbEnergy() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -37,10 +39,10 @@ public class ItemOrbEnergy extends ItemOrb {
|
|||
if (!entityPlayer.canPlayerEdit(par4, par5, par6, par7, itemStack)) {
|
||||
return false;
|
||||
} else {
|
||||
int i1 = world.getBlockId(par4, par5, par6);
|
||||
if (i1 == 0) {
|
||||
Block i1 = world.getBlock(par4, par5, par6);
|
||||
if (i1 == Blocks.air) {
|
||||
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.blockID);
|
||||
world.setBlock(par4, par5, par6, BlockHandler.lightCube);
|
||||
}
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
return true;
|
||||
|
|
@ -49,15 +51,9 @@ public class ItemOrbEnergy extends ItemOrb {
|
|||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (entity instanceof EntityPlayer && par5) {
|
||||
((EntityPlayer)entity).addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2));
|
||||
MysticWorld.proxy.energyFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package mysticworld.items;
|
||||
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
|
@ -12,14 +12,15 @@ import net.minecraft.util.DamageSource;
|
|||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemOrbFire extends ItemOrb {
|
||||
public ItemOrbFire(int id) {
|
||||
super(id);
|
||||
public ItemOrbFire() {
|
||||
super();
|
||||
}
|
||||
|
||||
public boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving) {
|
||||
entityLiving.setFire(5);
|
||||
entityLiving.attackEntityFrom(DamageSource.magic, 7);
|
||||
itemStack.damageItem(1, entityLiving);
|
||||
@Override
|
||||
public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityPlayer, EntityLivingBase entity) {
|
||||
entity.setFire(5);
|
||||
entity.attackEntityFrom(DamageSource.magic, 7);
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +49,7 @@ public class ItemOrbFire extends ItemOrb {
|
|||
} else {
|
||||
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.setBlock(par4, par5, par6, Block.fire.blockID);
|
||||
par3World.setBlock(par4, par5, par6, Blocks.fire);
|
||||
}
|
||||
par1ItemStack.damageItem(1, par2EntityPlayer);
|
||||
return true;
|
||||
|
|
@ -65,15 +66,9 @@ public class ItemOrbFire extends ItemOrb {
|
|||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (entity instanceof EntityPlayer && par5) {
|
||||
((EntityPlayer)entity).addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0));
|
||||
MysticWorld.proxy.fireFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemOrbWater extends ItemOrb {
|
||||
public ItemOrbWater(int id) {
|
||||
super(id);
|
||||
public ItemOrbWater() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -21,7 +21,7 @@ public class ItemOrbWater extends ItemOrb {
|
|||
if (movingobjectposition == null) {
|
||||
return itemStack;
|
||||
} else {
|
||||
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
|
@ -31,7 +31,7 @@ public class ItemOrbWater extends ItemOrb {
|
|||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||
return itemStack;
|
||||
}
|
||||
if (world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0) {
|
||||
if (world.getBlock(i, j, k).getMaterial() == 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.setBlockToAir(i, j, k);
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
|
|
@ -58,10 +58,10 @@ public class ItemOrbWater extends ItemOrb {
|
|||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||
return itemStack;
|
||||
} else {
|
||||
int i1 = world.getBlockId(i, j, k);
|
||||
if (i1 == 0) {
|
||||
Block i1 = world.getBlock(i, j, k);
|
||||
if (i1 == Blocks.air) {
|
||||
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, Block.waterMoving.blockID);
|
||||
world.setBlock(i, j, k, Blocks.flowing_water);
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
}
|
||||
return itemStack;
|
||||
|
|
@ -74,14 +74,8 @@ public class ItemOrbWater extends ItemOrb {
|
|||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (par5) {
|
||||
MysticWorld.proxy.waterFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
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.SideOnly;
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemStaff extends Item {
|
||||
Random rand = new Random();
|
||||
|
||||
public ItemStaff(int id) {
|
||||
super(id);
|
||||
public ItemStaff() {
|
||||
super();
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(200);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
|
|
@ -22,4 +19,9 @@ public class ItemStaff extends Item {
|
|||
public boolean isFull3D() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,76 +5,52 @@ import mysticworld.entity.EntityChargeAir;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
public class ItemStaffAir extends ItemStaff {
|
||||
public ItemStaffAir(int id) {
|
||||
super(id);
|
||||
public ItemStaffAir() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
|
||||
if (itemStack.stackTagCompound == null)
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
if (itemStack.stackTagCompound.getBoolean("charging") == false) {
|
||||
itemStack.stackTagCompound.setBoolean("charging", true);
|
||||
}
|
||||
player.setItemInUse(itemStack, this.getMaxItemUseDuration(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
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
if (itemStack.stackTagCompound == null)
|
||||
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"));
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean current) {
|
||||
if (current) {
|
||||
entity.fallDistance = 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
private void chargeEffect(ItemStack itemStack, World world, EntityPlayer player) {
|
||||
double particleX = (player.posX - 0.5D) + rand.nextDouble();
|
||||
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);
|
||||
}
|
||||
@Override
|
||||
public void onUsingTick(ItemStack stack, EntityPlayer player, int count){
|
||||
chargeEffect(stack, player.worldObj, player, getMaxItemUseDuration(stack) - count);
|
||||
}
|
||||
|
||||
private void incrementData(ItemStack itemStack) {
|
||||
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1);
|
||||
}
|
||||
|
||||
private void resetData(ItemStack itemStack) {
|
||||
itemStack.stackTagCompound.setInteger("chargeTime", 0);
|
||||
itemStack.stackTagCompound.setBoolean("charging", false);
|
||||
private void chargeEffect(ItemStack itemStack, World world, Entity player, int charge) {
|
||||
double particleX = (player.posX - 0.5D) + itemRand.nextDouble();
|
||||
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)));
|
||||
MysticWorld.proxy.airFeetFX(world, particleX, particleY, particleZ, 1.0f + particleScale, 15);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,40 +2,25 @@ package mysticworld.items;
|
|||
|
||||
import mysticworld.MysticWorld;
|
||||
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.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
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 ItemStaffEarth(int id) {
|
||||
super(id);
|
||||
public ItemStaffEarth() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
if (entityPlayer.isSneaking()) {
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
||||
if (movingobjectposition == null) {
|
||||
return itemStack;
|
||||
} else {
|
||||
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
|
@ -55,7 +40,7 @@ public class ItemStaffEarth extends ItemStaff {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(new EntityChargeEarth(world, entityPlayer));
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
|
|
@ -67,125 +52,12 @@ public class ItemStaffEarth extends ItemStaff {
|
|||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (par5) {
|
||||
MysticWorld.proxy.earthFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean applyBonemeal(ItemStack itemStack, World par1World, int par2, int par3, int par4, EntityPlayer 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;
|
||||
return ItemOrbEarth.applyBonemeal(itemStack, par1World, par2, par3, par4, player);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,25 +8,22 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class ItemStaffEnegy extends ItemStaff {
|
||||
public ItemStaffEnegy(int id) {
|
||||
super(id);
|
||||
public ItemStaffEnegy() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
if (entityPlayer.isSneaking()) {
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
||||
if (movingobjectposition == null) {
|
||||
return itemStack;
|
||||
} else {
|
||||
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
|
@ -59,7 +56,7 @@ public class ItemStaffEnegy extends ItemStaff {
|
|||
} else {
|
||||
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.setBlock(i, j, k, BlockHandler.lightCube.blockID);
|
||||
world.setBlock(i, j, k, BlockHandler.lightCube);
|
||||
}
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
return itemStack;
|
||||
|
|
@ -68,7 +65,7 @@ public class ItemStaffEnegy extends ItemStaff {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(new EntityChargeEnergy(world, entityPlayer));
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
|
|
@ -80,15 +77,9 @@ public class ItemStaffEnegy extends ItemStaff {
|
|||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (entity instanceof EntityPlayer && par5) {
|
||||
((EntityPlayer)entity).addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2));
|
||||
MysticWorld.proxy.energyFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,27 +3,26 @@ package mysticworld.items;
|
|||
import mysticworld.MysticWorld;
|
||||
import mysticworld.entity.EntityChargeFire;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class ItemStaffFire extends ItemStaff {
|
||||
public ItemStaffFire(int id) {
|
||||
super(id);
|
||||
public ItemStaffFire() {
|
||||
super();
|
||||
}
|
||||
|
||||
public boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving) {
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
@Override
|
||||
public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityPlayer, EntityLivingBase entityLiving) {
|
||||
if (entityPlayer.isSneaking()) {
|
||||
entityLiving.setFire(5);
|
||||
entityLiving.attackEntityFrom(DamageSource.magic, 7);
|
||||
itemStack.damageItem(1, entityLiving);
|
||||
|
|
@ -34,12 +33,12 @@ public class ItemStaffFire extends ItemStaff {
|
|||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
if (entityPlayer.isSneaking()) {
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
||||
if (movingobjectposition == null) {
|
||||
return itemStack;
|
||||
} else {
|
||||
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
|
@ -49,12 +48,12 @@ public class ItemStaffFire extends ItemStaff {
|
|||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||
return itemStack;
|
||||
} else {
|
||||
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(world.getBlockId(i, j, k), 1, world.getBlockMetadata(i, j, k)));
|
||||
if (!world.isRemote && !(result == null)) {
|
||||
int id = result.itemID;
|
||||
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(world.getBlock(i, j, k), 1, world.getBlockMetadata(i, j, k)));
|
||||
if (!world.isRemote && result != null) {
|
||||
Item id = result.getItem();
|
||||
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.setBlock(i, j, k, 0);
|
||||
world.setBlockToAir(i, j, k);
|
||||
world.spawnEntityInWorld(new EntityItem(world, i, j, k, new ItemStack(id, 1, meta)));
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
}
|
||||
|
|
@ -62,7 +61,7 @@ public class ItemStaffFire extends ItemStaff {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(new EntityChargeFire(world, entityPlayer));
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
|
|
@ -82,15 +81,9 @@ public class ItemStaffFire extends ItemStaff {
|
|||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (entity instanceof EntityPlayer && par5) {
|
||||
((EntityPlayer)entity).addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0));
|
||||
MysticWorld.proxy.fireFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,37 @@
|
|||
package mysticworld.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemStaffParts extends Item {
|
||||
private Icon[] icons;
|
||||
private IIcon[] icons;
|
||||
private static final String[] STAFF_PARTS = new String[] { "Staff", "Hilt", "Handle", "Head" };
|
||||
|
||||
public ItemStaffParts(int id) {
|
||||
super(id);
|
||||
public ItemStaffParts() {
|
||||
super();
|
||||
this.setHasSubtypes(true);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int meta) {
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
int j = MathHelper.clamp_int(meta, 0, STAFF_PARTS.length);
|
||||
return icons[j];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int var4 = 0; var4 < STAFF_PARTS.length; var4++) {
|
||||
par3List.add(new ItemStack(par1, 1, var4));
|
||||
}
|
||||
|
|
@ -51,10 +51,10 @@ public class ItemStaffParts extends Item {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
icons = new Icon[STAFF_PARTS.length];
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
icons = new IIcon[STAFF_PARTS.length];
|
||||
for (int i = 0; i < STAFF_PARTS.length; ++i) {
|
||||
icons[i] = iconRegister.registerIcon("MysticMods:StaffPart_" + STAFF_PARTS[i]);
|
||||
icons[i] = iconRegister.registerIcon("mysticworld:StaffPart_" + STAFF_PARTS[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
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,16 +6,14 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class ItemStaffWater extends ItemStaff {
|
||||
public ItemStaffWater(int id) {
|
||||
super(id);
|
||||
public ItemStaffWater() {
|
||||
super();
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(200);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
|
|
@ -23,12 +21,12 @@ public class ItemStaffWater extends ItemStaff {
|
|||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
if (entityPlayer.isSneaking()) {
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
|
||||
if (movingobjectposition == null) {
|
||||
return itemStack;
|
||||
} else {
|
||||
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
|
@ -38,7 +36,7 @@ public class ItemStaffWater extends ItemStaff {
|
|||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||
return itemStack;
|
||||
}
|
||||
if (world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0) {
|
||||
if (world.getBlock(i, j, k).getMaterial() == 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.setBlockToAir(i, j, k);
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
|
|
@ -65,10 +63,10 @@ public class ItemStaffWater extends ItemStaff {
|
|||
if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
|
||||
return itemStack;
|
||||
} else {
|
||||
int i1 = world.getBlockId(i, j, k);
|
||||
if (i1 == 0) {
|
||||
Block i1 = world.getBlock(i, j, k);
|
||||
if (i1 == Blocks.air) {
|
||||
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, Block.waterMoving.blockID);
|
||||
world.setBlock(i, j, k, Blocks.flowing_water);
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
}
|
||||
return itemStack;
|
||||
|
|
@ -78,7 +76,7 @@ public class ItemStaffWater extends ItemStaff {
|
|||
return itemStack;
|
||||
}
|
||||
} else {
|
||||
world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||
world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(new EntityChargeWater(world, entityPlayer));
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
|
|
@ -89,14 +87,8 @@ public class ItemStaffWater extends ItemStaff {
|
|||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (par5) {
|
||||
MysticWorld.proxy.waterFX(world, (entity.posX - 0.5D) + itemRand.nextDouble(), entity.posY, (entity.posZ - 0.5D) + itemRand.nextDouble(), 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +1,19 @@
|
|||
package mysticworld.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mysticworld.MysticWorld;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemVoidShard extends Item {
|
||||
public ItemVoidShard(int id) {
|
||||
super(id);
|
||||
public ItemVoidShard() {
|
||||
super();
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
this.setMaxDamage(1);
|
||||
|
|
@ -29,7 +28,7 @@ public class ItemVoidShard extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack itemStack) {
|
||||
public boolean hasEffect(ItemStack itemStack, int i) {
|
||||
if (itemStack.stackTagCompound == null)
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
if (itemStack.stackTagCompound.hasKey("filled")) {
|
||||
|
|
@ -45,7 +44,7 @@ public class ItemVoidShard extends Item {
|
|||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
int experience = entityPlayer.experienceLevel;
|
||||
int experienceSubtract = entityPlayer.experienceLevel - 30;
|
||||
if (itemStack.stackTagCompound.getBoolean("filled") == false) {
|
||||
if (!itemStack.stackTagCompound.getBoolean("filled")) {
|
||||
if (experience > 0 && experience <= 30) {
|
||||
entityPlayer.experienceLevel = 0;
|
||||
itemStack.stackTagCompound.setInteger("xpStored", experience);
|
||||
|
|
@ -63,10 +62,4 @@ public class ItemVoidShard extends Item {
|
|||
}
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
itemIcon = iconRegister.registerIcon("MysticMods:ShardVoid");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
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,6 +2,7 @@ package mysticworld.lib;
|
|||
|
||||
public class Booleans
|
||||
{
|
||||
public static boolean ENABLE_IMBUED_STONE_GEN;
|
||||
public static boolean ENABLE_BUSH_GEN;
|
||||
public static boolean ENABLE_GLACIER_GEN;
|
||||
public static boolean ENABLE_JUNGLE_REWRITE;
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
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;
|
||||
|
||||
}
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
package mysticworld.lib;
|
||||
|
||||
public class ItemIds {
|
||||
|
||||
//Default Item IDs
|
||||
public static int STAFF_PARTS_DEFAULT = 5503;
|
||||
|
||||
public static int IMBUED_SHARD_DEFAULT = 5504;
|
||||
|
||||
public static int FIRE_STAFF_DEFAULT = 5505;
|
||||
public static int WATER_STAFF_DEFAULT = 5506;
|
||||
public static int EARTH_STAFF_DEFAULT = 5507;
|
||||
public static int AIR_STAFF_DEFAULT = 5508;
|
||||
public static int ENERGY_STAFF_DEFAULT = 5509;
|
||||
|
||||
public static int STAFF_POWER_DEFAULT = 5510;
|
||||
|
||||
public static int BUSH_FRUIT_DEFAULT = 5511;
|
||||
|
||||
public static int VERDITE_HELMET_DEFAULT = 5512;
|
||||
public static int VERDITE_CHESTPLATE_DEFAULT = 5513;
|
||||
public static int VERDITE_LEGGINGS_DEFAULT = 5514;
|
||||
public static int VERDITE_BOOTS_DEFAULT = 5515;
|
||||
|
||||
public static int MITHRIL_HELMET_DEFAULT = 5516;
|
||||
public static int MITHRIL_CHESTPLATE_DEFAULT = 5517;
|
||||
public static int MITHRIL_LEGGINGS_DEFAULT = 5518;
|
||||
public static int MITHRIL_BOOTS_DEFAULT = 5519;
|
||||
|
||||
public static int ADAMANTINE_HELMET_DEFAULT = 5520;
|
||||
public static int ADAMANTINE_CHESTPLATE_DEFAULT = 5521;
|
||||
public static int ADAMANTINE_LEGGINGS_DEFAULT = 5522;
|
||||
public static int ADAMANTINE_BOOTS_DEFAULT = 5523;
|
||||
|
||||
public static int IRIDIUM_HELMET_DEFAULT = 5524;
|
||||
public static int IRIDIUM_CHESTPLATE_DEFAULT = 5525;
|
||||
public static int IRIDIUM_LEGGINGS_DEFAULT = 5526;
|
||||
public static int IRIDIUM_BOOTS_DEFAULT = 5527;
|
||||
|
||||
public static int FIRE_ORB_DEFAULT = 5528;
|
||||
public static int WATER_ORB_DEFAULT = 5529;
|
||||
public static int EARTH_ORB_DEFAULT = 5530;
|
||||
public static int AIR_ORB_DEFAULT = 5531;
|
||||
public static int ENERGY_ORB_DEFAULT = 5532;
|
||||
|
||||
public static int VOID_SHARD_DEFAULT = 5533;
|
||||
|
||||
//Current Item IDs
|
||||
public static int STAFF_PARTS;
|
||||
|
||||
public static int IMBUED_SHARD;
|
||||
|
||||
public static int FIRE_STAFF;
|
||||
public static int WATER_STAFF;
|
||||
public static int EARTH_STAFF;
|
||||
public static int AIR_STAFF;
|
||||
public static int ENERGY_STAFF;
|
||||
|
||||
public static int STAFF_POWER;
|
||||
|
||||
public static int BUSH_FRUIT;
|
||||
|
||||
public static int VERDITE_HELMET;
|
||||
public static int VERDITE_CHESTPLATE;
|
||||
public static int VERDITE_LEGGINGS;
|
||||
public static int VERDITE_BOOTS;
|
||||
|
||||
public static int MITHRIL_HELMET;
|
||||
public static int MITHRIL_CHESTPLATE;
|
||||
public static int MITHRIL_LEGGINGS;
|
||||
public static int MITHRIL_BOOTS;
|
||||
|
||||
public static int ADAMANTINE_HELMET;
|
||||
public static int ADAMANTINE_CHESTPLATE;
|
||||
public static int ADAMANTINE_LEGGINGS;
|
||||
public static int ADAMANTINE_BOOTS;
|
||||
|
||||
public static int IRIDIUM_HELMET;
|
||||
public static int IRIDIUM_CHESTPLATE;
|
||||
public static int IRIDIUM_LEGGINGS;
|
||||
public static int IRIDIUM_BOOTS;
|
||||
|
||||
public static int FIRE_ORB;
|
||||
public static int WATER_ORB;
|
||||
public static int EARTH_ORB;
|
||||
public static int AIR_ORB;
|
||||
public static int ENERGY_ORB;
|
||||
|
||||
public static int VOID_SHARD;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue